Does Fluent respect Access Levels?
If I use the fluent API to get my pages...is it giving me all pages or just pages that my user has access to see.
I would ASSUME all pages, so if that's the case, how do I filter it?
Thanks
Steve :)
Hi Steve,
You get all pages. Each PageNode is ISecured object, so you can check the permissions for a given role/user
var pn = man.GetPageNode(pageNode.Id);
var granted = pn.IsGranted(SecurityConstants.Sets.Pages.SetName, SecurityConstants.Sets.Pages.View);
//option 2
var perm = man.GetPermission(SecurityConstants.Sets.Pages.SetName, pn.Id, SecurityManager.GetCurrentUserId());
// get the permission set
var cs = pn.Permissions.Where(p => p.IsGranted(SecurityConstants.Sets.Pages.SetName, SecurityConstants.Sets.Pages.View));
Ahh thanks :)
Do you think this could be perhaps wrapped into the fluent api somehow, like a Where().HasAccess() or something?
Hello Steve,
I will put this as a request for future implementation in the fluent api methods.
Regards,
Ivan Dimitrov
the Telerik team
Thanks Ivan :)