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 ListReferencing User Roles in xslReferencing User Roles in xsl
Previous
 
Next
New Post
6/13/2008 1:17 PM
 

Hi, I'm attempting to edit the OnlyOwnItems.xsl file to display the information I want (for specific users based on role).

I just want to add a test to allow users with a specific role to be able to view all items (so in other words, the "for" statements would be true for 1) the user that created the row, 2) administrator, and 3) the "Attendance Viewer" role that I created. I can't figure out for the life of me how to test if the current user is in that role!

Basically I'm not sure whether when it says "|role1|" if I'm supposed to type my role name instead of role'x' or what? I'm probably doing something slightly wrong, but that is the way it always is isn't it?

Below is one of my tries. Can you give me any tips? Using UDT 3.04

<xsl:variable name ="IsViewer"   select="contains(//udt:Context/udt:Roles,'|Attendance Viewer|')"/> 

 

This isn't registering as "True" though.

 

Thank you very much! 

 

 
New Post
6/13/2008 5:26 PM
 

Stuartt, there is only a  typo, everything else is ok and should work.

<xsl:variable name ="IsViewer"   select="contains(//udt:Context/udt:UserRoles,'|Attendance Viewer|')"/>

Stuartt wrote

Thank you very much!  

You are welcome!

 
New Post
6/16/2008 3:06 PM
 

Hi Stefan,

I tried it that way, but it shows none of the items for users in that role. I don't get an error with the xsl file, but it doesn't seem to be recognizing the Attendance Viewer role. I can do what I need by hardcoding the specific usernames, but that is a long list.

Do you see anything else that might be off, or know of another way to reference users who are in a specific custom role? Obviously I don't want to make these users all administrators.

Thanks again for your help!

 
New Post
6/16/2008 5:12 PM
 

Weired.

Login as a user that is member of the Attendance Viewer role and look at the XML behind (via module action menu), verify that it contains |Attendance Viewer|. Compare again with your XSL. You can also download XML and XSL and test it offline, for example in VS2008 professional.

Feel free to send me XML and XSL per mail, maybe I can help.

 
New Post
6/16/2008 6:57 PM
 

I knew it was something simple. I typed Viewer instead of Viewers. Making me check the xml helped me find it. Wonderful work. Cheers!

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListReferencing User Roles in xslReferencing User Roles in xsl


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