+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Hiding control properties by role

Hiding control properties by role

2 posts, 0 answered
  1. Jeff Vail
    Jeff Vail avatar
    14 posts
    Registered:
    06 Dec 2003
    11 Nov 2010
    Link to this post
    I vaguely remember in the Falafel training I attended that you could show/hide control properties based on the user's role.  Assuming I am remembering this right, can anyone point me to documentation on how to do this?  I think it was by adding attributes to the properties.

    Thanks,
    Jeff
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    11 Nov 2010
    Link to this post
    Hello Jeff,

    You can do this only on the front end. The easiest way to do it is checking the user roles - UserManager.GetRolesForUser(usernme) in Page_Load and then set the Visibility property of some controls you have in your template. The control designer of each control gets the properties through PropertyDescriptor and setting attributes like "Browsable" at runtime is not supported.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered