Obtain Page/Widget Permissions

Posted by Community Admin on 03-Aug-2018 19:04

Obtain Page/Widget Permissions

All Replies

Posted by Community Admin on 03-Nov-2010 00:00

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 ?

Posted by Community Admin on 03-Nov-2010 00:00

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

This thread is closed