Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListFiltering List on Security RoleFiltering List on Security Role
Previous
 
Next
New Post
1/14/2010 9:26 PM
 

I tried the methods described in the following two threads and the first did not filter at all and the second filtered everything out so that I couldn't get any of the rows to appear.

Filter list on User Security Role

Restricting access with User Rights

The application is as follows. I have a list of chemicals. I have 20 locations that ship different subsets of the the chemical list. I need to centrally manage changes to the list but each location only wants to see their list of chemicals when they login. I created a custom XSLT to format the table to adjust alignment and apply font attributes.

Ideally, I would like to create 20 security roles and one text column where we could enter all of the locations separated by commas and the XSLT would compare the contents of the text column to the security roles and display the row if there is a match, similar to doing a "contains" search on the column.

This is what I have so far for the XSLT: http://bit.ly/7qdK3s

Thanks in advance for the help!

 

 

 
New Post
1/18/2010 3:04 PM
 

I have nearly figured it out using parts of the script on this forum post 

You can generate your own XSLT and format the fields as you desire. Once you have it where you want, add the following:

1) Just below the header information where the script begins naming parameters, I added the following:
  <xsl:param name="param_search" />
  <xsl:param name="param_searchpostback" />
  <xsl:param name="param_ispostback" />

2) After the "orderDirection" and "orderType" variable scripts I added:
   <xsl:variable name="search">
    <xsl:choose>
      <xsl:when test="$param_ispostback">
        <xsl:value-of select="$param_searchpostback" />
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$param_search" />
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>

3) Drop down to the code string <xsl:template match="/udt:UserDefinedTable"> and add:
    <xsl:variable name="searchColumns" select="//udt:Fields[udt:Searchable='true']/udt:ValueColumn" />
    <xsl:variable name="filteredData" select="udt:Data[(contains(/udt:UserDefinedTable/udt:Context/udt:UserRoles, concat('|',udt:User,'|')) or (/udt:UserDefinedTable/udt:Context/udt:IsAdministratorRole = 'true')) and (contains(*[name()=$searchColumns][1],$search) or contains(*[name()=$searchColumns][2],$search) or contains(*[name()=$searchColumns][3],$search) or contains(*[name()=$searchColumns][4],$search) or contains(*[name()=$searchColumns][5],$search)or contains(*[name()=$searchColumns][6],$search)or contains(*[name()=$searchColumns][7],$search)or contains(*[name()=$searchColumns][8],$search)or contains(*[name()=$searchColumns][9],$search)or contains(*[name()=$searchColumns][10],$search))]" />

"User" is a field in your list that the filter will search for a match of your security roles. You can name it whatever you want but make sure it matches the field name in your UDT.

4) Find and replace any instance of "currentData" should be changed to "filteredData"

Now, the last thing I need to figure out is how to format the list of security roles to be placed in the "User" field. Right now, I have it as text and if I have a role of "Subscribers" listed in the field it will allow all Subscribers to see the row of data. But if I have "Subscribers, Registered User" it searches for a role that matches both, not either one.

Any help would be appreciated.

 
New Post
1/19/2010 4:10 PM
 

I gave up on trying to filter on multiple security roles but I did discover a way to filter on multiple user names entered into a text field. Here is the code:

<<xsl:variable name="filteredData" select="udt:Data[(contains(udt:User, /udt:UserDefinedTable/udt:Context/udt:UserName) or (/udt:UserDefinedTable/udt:Context/udt:IsAdministratorRole = 'true')) and (contains(*[name()=$searchColumns][1],$search) or contains(*[name()=$searchColumns][2],$search) or contains(*[name()=$searchColumns][3],$search) or contains(*[name()=$searchColumns][4],$search) or contains(*[name()=$searchColumns][5],$search)or contains(*[name()=$searchColumns][6],$search)or contains(*[name()=$searchColumns][7],$search)or contains(*[name()=$searchColumns][8],$search)or contains(*[name()=$searchColumns][9],$search)or contains(*[name()=$searchColumns][10],$search))]" />

The instructions in the prior post would still apply. I highlighted the portion that has been changed.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListFiltering List on Security RoleFiltering List on Security Role


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out