1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Customize "Who can view this page and its child pages" dialogs

Customize "Who can view this page and its child pages" dialogs

6 posts, 0 answered
  1. Matt Palmer
    Matt Palmer avatar
    6 posts
    Registered:
    16 Jul 2009
    19 Feb 2013
    Link to this post

    I'm trying to determine if it would be possible to modify the "Who can view this page and its child pages" dialogs in Sitefinity, throughout the site (pages, content blocks, forums, etc), to add a set of custom criteria in addition to the roles and users selection that is built in. Is there a place in the SDK I could make this modification, or are the methods for determining what content is visible to a user inaccessible in some Sitefinity dll?

  2. Jen Peleva
    Jen Peleva avatar
    568 posts
    Registered:
    10 Nov 2016
    22 Feb 2013
    Link to this post
    Hi Matt,

    Thank you for using our services.

    Actually, the permissions you're referring to are configured through a public control, calle ItemActionPermissionsList. Since permissions in this control are set by calling the Permissions service, the only way you can add additional logic to it would be by mapping the template of this control, adding your own control to the markup (for example a textbox) and in the code-behind execute your own logic. You can use the permissions API from our documentation:

    http://www.sitefinity.com/documentation/documentationarticles/developers-guide/deep-dive/security/permissions

    I'm attaching the default template to this reply. To map it through Sitefinity go to Administration -> Settings -> Advanced -> Viewmap and create a new Viewmap instance wiht the following details:

    HostType:Telerik.Sitefinity.Web.UI.Backend.Security.Permissions.ItemActionPermissionsList
    layoutTemplatepath: ~/RelativePathToTemplate.ascx

    Hope this helps!

    All the best,
    Jen Peleva
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Matt Palmer
    Matt Palmer avatar
    6 posts
    Registered:
    16 Jul 2009
    22 Feb 2013 in reply to Jen Peleva
    Link to this post

    Thanks! In the permissions API documentation, it says the principal ID can be the ID of a user or a role. I'm trying to determine if we could develop a customization to grant permissions based on a different custom table (not a role or specific user). 

    I think I understand from your reply and the sample code how I could modify the dialog to allow the administrator to select these custom permissions, but how would we go about enforcing them when a user is browsing the CMS?

  4. Jen Peleva
    Jen Peleva avatar
    568 posts
    Registered:
    10 Nov 2016
    27 Feb 2013
    Link to this post
    Hi Matt, 

     Can you provide us with an example on what you want to achieve with the custom permissions? If you're setting permissions to pages by some custom condition, what will it be related to, if not to roles and users?

    Greetings,
    Jen Peleva
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Matt Palmer
    Matt Palmer avatar
    6 posts
    Registered:
    16 Jul 2009
    28 Feb 2013
    Link to this post

    We would like to base the permissions on organizations the user belongs to. The organizations and member management would be based on custom tables. Is there someplace we could hook into the process that determines if a user has permission to view a given piece of content and insert logic to check their membership in these organizations?

  6. Jen Peleva
    Jen Peleva avatar
    568 posts
    Registered:
    10 Nov 2016
    05 Mar 2013
    Link to this post
    Hi Matt,

    Since this involves modifying core functionality I would suggest you to set roles to your users, depending on their membership. This can be done by code again. You can query the information from the custom tables and depending on it set a role to a user (if he/she belongs to some membership). Here's the role API:

    http://www.sitefinity.com/documentation/documentationarticles/developers-guide/deep-dive/security/roles 

    Kind regards,
    Jen Peleva
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
6 posts, 0 answered