Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • tc 41 posts 62 karma points
    Aug 01, 2012 @ 12:14
    tc
    0

    Hiding the Content tab from a user in Umbraco

    I am looking into creating a custom app/tab in Umbraco, as an addition to the current ones (Content, Media etc..). The tab I am creating is called Articles and simply lists nodes of the article doctype (i will move onto filter this by logged in user).

    I want to set it so that on logging in, a user will only see this tab for Articles, and not the others (content, media...).

    I understand that I cannot simply un-check the Content tab in the users permissions as this would remove the users access to all the nodes and therefore they would not be able to browse any in this new tab.

    What I'm wondering is, is there a way to simply hide this tab from the user?

    For a bit of background.. Im trying to make a system whereby the content trees depend on the current user. So user 1 would only see their articles etc. Setting the start node in content is not enough as there are other nodes at different levels that the user should have access to. So I have decided to create a custom app/tab to grab all the nodes for the current user. In starting this I found that I cant simply remove the Content tab from their permissions, and that's led me to here. Any help/pointers with this would be great!

  • Dan 1285 posts 3917 karma points c-trib
    Aug 01, 2012 @ 14:23
    Dan
    0

    Hi,

    It should be possible to do this but I'm a little confused by the terminology.  Generally, the sections in the bottom left of the Umbraco UI (Content, Media, Developer etc) are called 'sections' and the tabbed panels in the main right-hand-side portion of the screen are termed 'tabs'.  I think what you're calling tabs are actually sections?

    It's possible to control the display of sections per user/group using the built-in permissions.  If you wanted a filtered node tree for a particular user or user group you could build the filtering logic into the standard content tree or you could build a new section with the filtering logic and control the permissions accordingly for that new section.

    If it's tabs, there's nothing in the core to do this, but there are some packages which provide show/hide control for tabs on a per user/group basis, e.g. http://our.umbraco.org/projects/backoffice-extensions/uhidesy and http://our.umbraco.org/projects/backoffice-extensions/attackmonkey-tab-hider.

    I hope this helps.  If not, maybe try to clarify the terminology a little and it should be easier to offer advice on.

  • tc 41 posts 62 karma points
    Aug 01, 2012 @ 14:44
    tc
    0

    Hi Dan,

    Thanks for your response, Apologies, to clear up the terminology..

    Its the "Sections" that I want to control (Content, Media etc..). I have created a custom section, with a custom tree and want the users to have access to this section only. However, I cannot simply hide the Content section by unchecking it in their permissions as this means the user has access to no content at all. So even when I try to show nodes in another tree, they will not show. So, it seems, I need to keep access to the Content section. The problem with this however, is that this means the Content section button (lower left) will be displayed, I dont want the users to have the option of viewing the content tree, just my custom section.

    For this reason, I'm trying to find if there is a way to keep access to all the content, but hide the content section in the back end. 

  • Dan 1285 posts 3917 karma points c-trib
    Aug 01, 2012 @ 15:45
    Dan
    0

    Ah, I see.

    Have you tried setting the user permissions to allow the content section to be viewed, but putting a 'deny' setting in the 'config > Dashboard.config' file?  Like this: 

      <section alias="StartupDashboardSection">
       <access>
          <deny>translator</deny>
    <deny>yourUserGroup</deny>
        </access>
        <areas>
          <area>content</area>
        </areas>
        <tab caption="Get Started"> ...

     I'm not sure how deep-rooted these config settings are, so I don't know if this will work but it's worth a shot.  If not, then the only way I could think of doing it would be something quite hacky, like injecting some CSS into the back-office to hide the content section button.

  • tc 41 posts 62 karma points
    Aug 01, 2012 @ 19:06
    tc
    0

    HI Dan, thanks for your responce.

    I have previosly tried setting these in the config and the tabs would then be hidden from the user. Something like this, but for sections would be great. However, I'm starting to think that there may not be an easy solution... Like you say, some sort of hacky CSS to set a display:none on the button or something like that. I'll experiment, but thanks for your suggestions!

  • Dan 1285 posts 3917 karma points c-trib
    Aug 02, 2012 @ 14:59
    Dan
    0

    Hi,

    I just saw this new package: http://our.umbraco.org/projects/backoffice-extensions/epiphany-custom-content-tree and it reminded me of this thread - could it help with your scenario?

  • tc 41 posts 62 karma points
    Aug 02, 2012 @ 19:08
    tc
    0

    Hi Dan,

    Thanks for that link, seems like it could be very useful!
    I'm not sure if it hides the content tab or just adds the new custom sections, i'll investigate, the multiple start nodes would be another way to avoid having to hide the content tab so looks promising!

    I'll install it and have a play, and report back.

    Thanks again for finding this! 

  • tc 41 posts 62 karma points
    Aug 04, 2012 @ 16:55
    tc
    1

    Hi Dan,

    Just to let you know, that package does the trick!
    Now, when a user signs up, I write to the config file to set what nodes they have access to.

    While not exactly hiding the content tab, your help has given me another solution to this issue, thanks.

     

Please Sign in or register to post replies

Write your reply to:

Draft