Forums

Skip Navigation LinksHome / Developer Network / Forums / Sitefinity Older Versions (3.x): Security > Page Permissions

Page Permissions

  • Doug Dawson avatar

    Posted on Nov 22, 2010 (permalink)

    Hello!

    I don't understand how page permissions work. Here's the method:

    string[] roles = { "RoleName" };
    ISecured sPage = (ISecured)MyPage;

    sPage.SetPermissions(Telerik.Cms.Security.PageRights.View, Telerik.Cms.Security.PageRights.Delete, roles);

    If I want a role to have edit and delete, do I have to call this twice or does delete permission mean you have edit permissions? The API docs don't say anything about what the int value means.

    Thanks!

    Doug

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Nov 22, 2010 (permalink)

    Hi Doug,

    This method sets the specified permission for the specified roles. The first parameter is used for setting the allow rights, the second for deny and the third is array of roles. If you want to grant View and Create and deny Delete you can use this code

    sPage.SetPermissions(Telerik.Cms.Security.PageRights.View | Telerik.Cms.Security.PageRights.Create, Telerik.Cms.Security.PageRights.Delete, roles);

    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

    Reply

  • Doug Dawson avatar

    Posted on Nov 22, 2010 (permalink)

    Ah! I see now. I didn't see it documented anywhere that this "grant" int was a bitwise result. It might be helpful to indicate that in the documentation. I usually don't work with bitwise stuff, so it didn't occur to me.

    Reply

  • Register for webinar
Skip Navigation LinksHome / Developer Network / Forums / Sitefinity Older Versions (3.x): Security > Page Permissions