How to get role details assigned to Page in Permission
I am implementing an application where i need to know dynamically the role assigned to the pages. I am looking to your forum however there is no solution provided and also trying several approaches for this but no luck. Please let me know how to get role assigned to pages in permission so that I continue my work.
It has become blocker for me to continue my work. I will be grateful for quick response from your side.
Awaiting for the response.
There is entire section in our dev manual that explains the permissions. Please take a look at it.
the Telerik team
Thanks Ivan, for the reply. I have gone through the dev guide. It includes the Role managment for users however i m looking for role assigned to Pages. How to get the roles of the pages. Please help in this scenario with some useful example. Your guidance will be great support for me to continue my work.
First you need to identify for which permission set you will get the role. Each permission set could have role or user assigned. The page has permissions. Permissions are associated with roles, so we assign permissions to a role and permissions to a page, but not role to page
Below is a sample code
var manager = PageManager.GetManager();
var roleID = new Guid("263d4a0a-9e35-4d30-ad13-edac983cde39");
var pgID = new Guid("439A6A30-D2C2-4EE7-A148-2344BB5CC4E6");
var mp = App.WorkWith().Page(pgID).Get();
var checkPerm = manager.GetPermission(SecurityConstants.Sets.Pages.Delete, mp.Id, roleID);
the Telerik team
Thanks for the example and details.
My scenario is that when somebody hit the page or request for the particular page, then we need to know which role is set in the permission for that page to view the page. We would need to have Role details so that we can use in our further implementation in application. So in this case we don't know which role is set in permission for page. I need to get that role which is set for page. Please let me know what can i do in this case as GetPermsission() methods need Role id.But here i need to get role ID only for that page.
Please hlep me so that i could continue my work.
For this case you can use GetActivePermissions which returns all permissions for this item by an expression of Permission objects. From the permission object you can get
- grant/deny action.
- ObjectId - the object you query
- PrincipalId the role with permissions.
Thanks so much.
Could we use PageDataList() of class PageData instead of PageNode as in my scenario I am not having data through PageNode. Please suggest me getting alternative way to use PageNode for your given example.
Thanks for all ur support