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

Forums / General Discussions / Hiding the "Pages" Site Map in the Dashboard to Users

Hiding the "Pages" Site Map in the Dashboard to Users

3 posts, 0 answered
  1. Troy Benedict
    Troy Benedict avatar
    37 posts
    Registered:
    29 Apr 2009
    06 Oct 2010
    Link to this post
    We have a link for all of our users that redirects them to the dashboard to change their password.  However, the tab also includes a list of all of the pages they currently have access to.  I do not want them to see these, as some of them are still in development. 

    Is there a way to disable the viewing of the "Pages" section for non-employee users much like it does with the Files, Modules, and Administration sections by graying them out? 

    We are currently using version 3.6.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    06 Oct 2010
    Link to this post
    Hi Troy,

    You can access the pages link inside Sitefinity\Admin\Default.aspx.cs. - hintsPanel_DataBound. From there you can hide/disable pagesLink for these users

    Kind 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
  3. Jason Watts
    Jason Watts avatar
    1 posts
    Registered:
    22 Oct 2008
    20 Oct 2010
    Link to this post
    I just wanted to follow up to this post with an alternative solution. The recommendation provided did not work exactly like we wanted. We are using 3.7. We were trying to hide the "Dashboard" and "Pages" link from all but administrators. Actually, we only wanted them to see the "Modules" and "Live Site" links, and for the Modules, only the 2 custom modules that we added. The built-in permissions got us most of the way on that, but it didn't work for "Dashboard" and "Pages".

    Here is what I did. First I used some JavaScript to re-route a non-admin user to the modules page should they end up on the Default.aspx page. Probably could've/should've done it server-side, but this works. I added it to the very bottom script tag in Sitefinity/Admin/Admin.master.
    try {
        var _IsSysAdmin = <%=Convert.ToString(Telerik.Security.UserManager.IsCurrentUserInRole("administrators")).ToLower()%>;
        if (!_IsSysAdmin) {
            //If the user is not an admin, move them to the modules 
            //page if they are on the default page
            if (window.location.href.toLowerCase().indexOf("mywebsitename.org/sitefinity/admin/default.aspx") >= 0) {
                window.location.href = "http://www.mywebsitename.org/Sitefinity/Admin/Modules.aspx";
            }
        }
    } catch (e) {}

    Next I edited the Page_Load event of the same Admin.master page. Since the menu is a RadTabStrip, I just hid the tabs we didn't want:
    protected void Page_Load(object sender, EventArgs e)
    {
        this.userName.Controls.Add(new LiteralControl(Telerik.Security.UserManager.GetCurrentUserName()));
        this.projectName.Controls.Add(new LiteralControl(Telerik.Cms.Web.UrlHelper.GetProjectName()));
        // BEGIN EXCLUDE FOR COMMUNITY
        this.langList.Visible = LocalizationManager.PersistenceMode != LocConfig.PersistenceMode.None;
        // END EXCLUDE FOR COMMUNITY
        this.MainMenu.DataBind();
     
        //Begin Customization
        if (!Telerik.Security.UserManager.IsCurrentUserInRole("administrators"))
        {
            foreach (RadTab tab in this.MainMenu.Tabs)
            {
                if (tab.Text.Equals("Dashboard")) {
                    tab.Visible = false;
                }
                if (tab.Text.Equals("Pages"))
                {
                    tab.Visible = false;
                }
            }
        }
        //End Customization
    }

    This worked perfectly for us. When non-admins log in they are immediately routed to the modules page, and the Dashboard and Pages links don't show up. 

    Note: You can set the default homepage of a user to the modules page, which we do in our new users form. It goes kind of like this:
    System.Web.Security.MembershipUser u = Telerik.Security.UserManager.Default.GetUser("UserName");
    Telerik.Personalization.PersonalizationManager pm = new Telerik.Personalization.PersonalizationManager();
    pm.SaveGlobalValue<string>(u.UserName, "startPage", "~/Sitefinity/Admin/Modules.aspx");






Register for webinar
3 posts, 0 answered