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

Forums / General Discussions / Obtain Page/Widget Permissions

Obtain Page/Widget Permissions

2 posts, 0 answered
  1. JV
    JV avatar
    74 posts
    Registered:
    15 Jun 2012
    03 Nov 2010
    Link to this post
    Hi,

    I have one page with one widget developed by me.
    In thar Widget i need to obtain this information:

     - check the current user permission for this page
     - check the current user permission for this widget

    to obtain the page permissions i used

     

     

    var per1 = page.IsGranted(SecurityConstants.Sets.Pages.SetName, SecurityConstants.Sets.Pages.View);

     

     

     

    var per2 = page.IsGranted(SecurityConstants.Sets.Pages.SetName, SecurityConstants.Sets.Pages.EditContent);

     


    How can i check the level of permission to the widget in that page ?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    03 Nov 2010
    Link to this post
    Hi JV,

    The PageControl class implements IOwnership interface with the following members

    • InheritsPermissions - Defines if the implemented type inherits permissions from a parent object.
    • Permissions - A list of defined permissions
    • PermissionChildren - gets or sets a list of PermissionsInheritanceMap objects, each containing a mapping to a child secured object which inherits permissions directly from this object.
    • SupportedPermissionSets - Gets the permission sets relevant to this specific secured object.
    • CanInheritPermissions - Gets or sets a value indicating whether this instance can inherit permissions.
    • PermissionsetObjectTitleResKeys -permissionset for object titles
    You can get your control from page controls collection - page.Controls.Where(...). Then you can call
    control.Permissions which returns IList of Permission.

    Regards,
    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