DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Hidding the Personal Bar for users with edit permissions just on modules

Sort:
You are not authorized to post a reply.





Growing Member





    Is there a way on DNN9 to NOT show the persona bar for users that have edit permissions on a give module?
    This is causing some trouble a couple web site recently migrated from earlier versions where the users get somewhat annoyed with the left menu bar that they don't have to use at all. The site uses some custom modules that made use of the "edit" controls and permissions but they just don't want to persona bar to appear for these users.
    So is that possible?
    Vicenç Masanas
    Disgrafic ITec SL Banyoles - Spain





    Veteran Member





      I think with some logic in the skin it's doable.
      Insert a class when a user is not an admin, but has page edit right and add.

      .IsEditor #personabar-wrap{
      display:none !important;
      }






      Veteran Member





        Ok, I did a quick test, you need:

        .personalBarContainer{
        display:none !important;
        }

        #Body{
         margin-left:0 !important;   
        }






        Growing Member





          Thank you Timo. But how would you add this from the skin? The problem I think is that the user has "Edit" permissions on the module, not at the page level.
          Vicenç Masanas
          Disgrafic ITec SL Banyoles - Spain





          Veteran Member





            I don't have time to test right now, but my first idea would be:

            DotNetNuke.Entities.Portals.PortalSettings.Mode.Edit = true

            DotNetNuke.Security.Permissions.TabPermissionController.CanManagePage = false

            Or DotNetNuke.Security.Permissions.TabPermissionController.CanAddContentToPage

            I'm curious if that would help as I could then add this option to our style helper

            (A class if the user is a Module Administrator)

             

             






            New Around Here





              Looks like this topic came up in a few places and 1 of them resulted in Aaron Lopez of Wolf X Machina adding a quick blog about it.

              >> Hide the PersonaBar from a Role in DNN 

              Two quick things to note,

              1. Aaron's is in VB, if your skin is C# (<%@ Control Language="C#" ...), then here is the improved version to include in your (.ascx) file:

              <% if(DotNetNuke.Security.PortalSecurity.IsInRole("Content Editors")) { %>
                <style&nbsp;type=&quot;text css=""><br />     #Body {
                    margin-left: 0 !important;
                  }
                  .personalBarContainer, .personaBarContainer {
                    display: none !important;
                  }
               
              <% } %>

              2. I added the CSS !important since for many situations, those are prolly needed and I also included the correctly spelled class ("persona" not "personal" (with the "L")) because DNN may fix a mistake like that someday (or not).

              Cheers!

              You are not authorized to post a reply.

              These Forums are dedicated to the discussion of DNN Platform.

              For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

              1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
              2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
              3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
              4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
              5. No Flaming or Trolling.
              6. No Profanity, Racism, or Prejudice.
              7. Site Moderators have the final word on approving / removing a thread or post or comment.
              8. English language posting only, please.

              Would you like to help us?

              Awesome! Simply post in the forums using the link below and we'll get you started.

              Get Involved