More in this section

Forums / Developing with Sitefinity / Roles, Approve before Publish

Roles, Approve before Publish

6 posts, 0 answered
  1. Dale Palmer
    Dale Palmer avatar
    20 posts
    Registered:
    12 May 2008
    12 Feb 2009
    Link to this post
    Is it possible to setup different roles so users in a certain role can only edit news and events in a certain category, and edit pages under a certain sub page?

    And is it also possible to have any changes confirmed by an administrator before the changes are published?

    Regards
  2. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    12 Feb 2009
    Link to this post
    I don't believe that you can currently restrict based on the category of a module content item (at least not out-of-the-box)...

    however you can restrict page access based on roles, though this feature is only available in the standard version (community version does not include workflow, and I believe only supports one user).

    You can create roles and users under the Administration->Users page, and assign users to roles as you create them, or modify roles by accessing the user's profile. Once that's done, select the page (or page group) that you want to restrict and select the Permissions tab. Here you can define the roles (such as view, create, modify, approve, publish) for that specific page or pages. You can set multiple roles have different permissions, for example, Editors role can View, Create, Modify; Approvers role can do the same plus Approve; Publishers role can do the same plus Publish.

    this is exactly how we do it here at our organization. works great! we have many departments, so setting role access to each section is tedious, but it is certainly possible!

    I hope this was helpful!
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    16 Feb 2009
    Link to this post
    Hi SelArom,

    Generally permissions are implemented per roles and the workflow is only for generic content items and pages. The first task could be done. Here is a sample prepared for the tags.

    1. Create a new class that inherits BlogsModule and override CreateControlPanel

    namespace Telerik.Blogs 
        public class CustomBlogsModule : BlogsModule 
        { 
            public CustomBlogsModule() 
                : base() 
            { 
     
            } 
     
            public override Control CreateControlPanel(TemplateControl parent) 
            { 
                return new BlogsControlPanel(); 
            } 
     
          
        } 

    2. Create a class that inherits ControlPanel

    public class BlogsControlPanel : ControlPanel 
        public BlogsControlPanel() 
        { 
            base.commandPnls = new CommandPanel[] { new BlogsCommandPanel(this) }; 
     
        } 

    3. Create custom command panel where we hide some of the buttons.

    public class BlogsCommandPanel : CommandPanel 
        public BlogsCommandPanel(ControlPanel panel):base(panel) 
        { 
        } 
     
        protected override void CreateChildControls() 
        { 
            base.CreateChildControls(); 
     
            if (!Telerik.Security.UserManager.IsCurrentUserInRole("everyone")) 
            { 
                GenericContainer<CommandPanel> container = null
                // then hide button here 
                foreach (Control control in this.Controls) 
                { 
                    if (control is GenericContainer<CommandPanel>) 
                    { 
                        container = control as GenericContainer<CommandPanel>; 
                        break
                    } 
                } 
                if (container != null
                { 
     
                    IButtonControl tagsButton = (IButtonControl)FindRecursive(container,"tagsView"); 
                    if (tagsButton is LinkButton) 
                    { 
                        ((LinkButton)tagsButton).Visible = false
                    } 
                    else if(tagsButton is Button) 
                    { 
                        ((Button)tagsButton).Visible = false
                    } 
                } 
            } 
        } 
     
        protected Control FindRecursive(Control parent, string id) 
        { 
            foreach( Control control in parent.Controls ) 
            { 
                if (control.ID == id) 
                { 
                    return control; 
                } 
                else if( control.Controls.Count > 0 ) 
                { 
                    Control c1 = FindRecursive(control, id); 
                    if (c1 != null
                        return c1; 
                } 
            } 
            return null
        } 
     


    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  4. Dale Palmer
    Dale Palmer avatar
    20 posts
    Registered:
    12 May 2008
    17 Feb 2009
    Link to this post
    Ivan,
     
    referring to the original question:

    Is it possible to setup different roles so users in a certain role can only edit news and events in a certain category, and edit pages under a certain sub page?

    What I want seems to be in the permissions for pages already - I can set a user to have create, modify and view permissions, but not approve or publish. However, when they create a page they can publish it straight away, should this happen? and if so what is point of the approve and publish permissions.


    Regards
    Dale
  5. Dale Palmer
    Dale Palmer avatar
    20 posts
    Registered:
    12 May 2008
    23 Feb 2009
    Link to this post
    Hi,

    still waiting for a response

    Dale
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    23 Feb 2009
    Link to this post
    Hello Dale Palmer,

    The permissions does not apply per category. They apply per module/provider. You could try hiding a certain buttons for a given role as my sample demonstrates.

    As for the page permissions - there is a special Owner role. By default the owner does not have permissions to approve and publish. Owner rights are with higher priority, the creator of the item will have the owner permissions even you if have denied them in another role( from 3.6 beta).

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
6 posts, 0 answered