Does Fluent respect Access Levels?

Posted by Community Admin on 03-Aug-2018 20:48

Does Fluent respect Access Levels?

All Replies

Posted by Community Admin on 16-Dec-2010 00:00

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 :)

Posted by Community Admin on 16-Dec-2010 00:00

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));


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

Posted by Community Admin on 16-Dec-2010 00:00

Ahh thanks :)

Do you think this could be perhaps wrapped into the fluent api somehow, like a Where().HasAccess() or something?

Posted by Community Admin on 16-Dec-2010 00:00

Hello Steve,

I will put this as a request for future implementation in the fluent api methods.

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

Posted by Community Admin on 16-Dec-2010 00:00

Thanks Ivan :)

This thread is closed