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

Forums / Developing with Sitefinity / Permission on specific page properties

Permission on specific page properties

17 posts, 0 answered
  1. Mike
    Mike avatar
    221 posts
    Registered:
    19 Aug 2008
    19 Feb 2009
    Link to this post
    I may have asked this before but is there a way to assign a specific role ONLY the ability to edit the pages Head Content and no other properties of the page...

    My specific senario is that we would liek to give an outside SEO company a username a password to log into our CMS and go through page by page and modify the pages Title, Description, and Keywords as needed. But it is very important not to allow them to be able to anything under General option or anything under the More Options of the page... These options are allot more sensitive than the head content...

    Even if i have to modify the module to allow this, any help would be great!

    Duncan
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    19 Feb 2009
    Link to this post
    Hello Duncan,

    Thank you for using our services.

    In Sitefinity 3.6 under permissions tab you can set whether the given role could Change Properties of this page.

    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.
  3. Mike
    Mike avatar
    221 posts
    Registered:
    19 Aug 2008
    19 Feb 2009
    Link to this post
    Hi Ivan,

    Thanks again for the reply. yes i am aware of this permissions setting. My issue is that i wish to allow a specific role the ability to modify ONLY the Page header Content (title, description, keywords) but no other properties... Just those...

    The Change Properties permission is very general... If i give a role access to the properties then they have the ability to do some very sensitive things like modify the caching or turn off the view state, even turn off the security on the page and change the page type. These are NOT permission i want to give this role. I just want them to be able to change the header content...

    Duncan
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    20 Feb 2009
    Link to this post
    Hi Duncan,

    There is a way to achieve the desired result.

    You need to add a code behind for ~/Sitefinity/Admin/ControlTemplates/Pages/PagePropertiesEdit.ascx
    Then in the code behind you should override OnPreRender method and  set which role what should see. Here is a sample:

        protected override void OnPreRender(EventArgs e) 
        {   
           if(Telerik.Security.UserManager.IsCurrentUserInRole("marketing")); 
            { 
               // here hide the control Literal1.Visible = false; 
               // or just make it as disabled. 
            } 
            base.OnPreRender(e); 
        } 

    I hope this helps.

    Regards,
    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.
  5. Mike
    Mike avatar
    221 posts
    Registered:
    19 Aug 2008
    20 Feb 2009
    Link to this post
    Excellent this is exactly what i need... I am going to try this now and let you know how it goes..

    Thanks,

    Duncan
  6. Mike
    Mike avatar
    221 posts
    Registered:
    19 Aug 2008
    20 Feb 2009
    Link to this post
    Works perfect...! Thank you very much!

    Duncan
  7. Mike
    Mike avatar
    221 posts
    Registered:
    19 Aug 2008
    20 Feb 2009
    Link to this post
    Ivan,

    One thing... It seems as though SitemapSelector.ascx is a little different? the OnPreRender override does not seem to fire... This is what i am trying to do, is there perhaps something i am missing?

    <%@ Control Language="C#" CodeFile="SiteMapSelector.ascx.cs" Inherits="SiteMapSelector" %> 
    <%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %> 
     
    <div class="sitemapTree"
        <telerik:RadTreeView ID="SiteNavigation" runat="server" Skin="SitefinitySiteMap" EnableEmbeddedSkins="false"></telerik:RadTreeView> 
    </div> 


    using System; 
    using System.Data; 
    using System.Configuration; 
    using System.Collections; 
    using System.Web; 
    using System.Web.Security; 
    using System.Web.UI; 
    using System.Web.UI.WebControls; 
    using System.Web.UI.WebControls.WebParts; 
    using System.Web.UI.HtmlControls; 
     
    public partial class SiteMapSelector : System.Web.UI.UserControl 
        protected override void OnPreRender(EventArgs e) 
        { 
            SiteNavigation.Visible = false
     
            if (Telerik.Security.UserManager.IsCurrentUserInRole("marketing")) 
            { 
                SiteNavigation.AllowNodeEditing = false
                SiteNavigation.EnableDragAndDrop = false
            } 
     
            base.OnPreRender(e); 
        } 

    I'm basically trying to disable the drag and drop reordering of the site map for this role...

    Duncan
  8. Mike
    Mike avatar
    221 posts
    Registered:
    19 Aug 2008
    20 Feb 2009
    Link to this post
    Sry the SiteNavigation.Visible = false; was me just testing to see if the override was even being hit...

    Duncan
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    23 Feb 2009
    Link to this post
    Hi Duncan,

    Let me know if you need further assistance in this matter.

    Kind regards,
    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.
  10. Mike
    Mike avatar
    221 posts
    Registered:
    19 Aug 2008
    23 Feb 2009
    Link to this post
    Hi Ivan,

    Yes please... In my previous post i asked about the SitemapSelector.ascx control and how it seems to not behave in the same way...

    When you have a chance please take a look at my post dated: 2/20/2009 12:25:34 PM

    Thanks,
    Duncan
  11. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    25 Feb 2009
    Link to this post
    Hello Duncan,

    The template that you should edit ~/Sitefinity/Admin/ControlTemplates/Pages/SiteMapPanel.ascx
    There is RadTreeView control that you could modify.

    <telerik:RadTreeView ID="SiteNavigation" EnableEmbeddedSkins="false" Skin="SitefinitySiteMap"  EnableDragAndDropBetweenNodes="true" runat="server" Width="190"></telerik:RadTreeView></div

    As you see there is a property EnableDragAndDropBetweenNodes which by default is set to "true".
    However you need to create a code behind and override EnableDragAndDrop property.

     protected override void OnPreRender(EventArgs e) 
        { 
            base.OnPreRender(e); 
            // here check whether the user is in a given role. 
            SiteNavigation.EnableDragAndDrop = false
        } 

    I hope this helps.

    All the best,
    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.
  12. Mike
    Mike avatar
    221 posts
    Registered:
    19 Aug 2008
    25 Feb 2009
    Link to this post
    Ivan,

    That worked perfectly... Thank you very much!!!

    Duncan
  13. sameer
    sameer avatar
    14 posts
    Registered:
    28 Apr 2009
    27 May 2009
    Link to this post
    hi
    i have issue near from this situation
    i give the user permissions to edit some pages
    but the problem if the user click edit this page he can drag and drop new control or delete control from the page
    i want force him to edit the content from the control on the page without add any new controal
    actual my question is how to hid this section (Add a Controls panel or Select a control ) for the edit page mode to specified role ?
  14. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    27 May 2009
    Link to this post
    Hello sameer,

    Please take a look at the following blog posts
    HACK: How to hide controls from toolbox section in Sitefinity 3.6
    Let's hide Upload Controls section from Sitefinity 3.6 toolbox

    I hope this helps.

    Sincerely yours,
    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.
  15. sameer
    sameer avatar
    14 posts
    Registered:
    28 Apr 2009
    28 May 2009
    Link to this post
    hi Ivan
    thanks for you reply
    i will read it and tell you what's happen
  16. sameer
    sameer avatar
    14 posts
    Registered:
    28 Apr 2009
    28 May 2009
    Link to this post
    perfect it's wthat i need exactly
    it's working good
    can you explan how i can hide also 
    2. Select a container drop down list ?
    3. and add button ?
    thanks
  17. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    28 May 2009
    Link to this post
    Hi sameer,

    Below is the extended code snipped of the blog post implementation.

            if (toolbox != null
            { 
                // find the container   
                Control control = toolbox.FindControl("controlsContainer"); 
     
                foreach (Control cntr in control.Controls) 
                { 
                    HtmlAnchor anchor = cntr as HtmlAnchor; 
                    if (anchor != null && anchor.HRef != null && anchor.HRef.IndexOf("toolbox.UploadControl()") >= 0) 
                    { 
                        anchor.Visible = false
                    } 
                    // remove add control button 
                    Button btn1 = cntr as Button; 
                    if (btn1 != null && btn1.ID == "addCtrl"
                    { 
                        btn1.Visible = false
                    } 
                    // remove the drop down for selecting the container. 
                    DropDownList zones = cntr as DropDownList; 
                    if (zones != null && zones.ID == "addCtrl_zns"
                    { 
                        zones.Visible = false
                    } 
                } 
            } 


    All the best,
    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
17 posts, 0 answered