Page 1 of 1

Remove 'Extensions' menu from control panel

Posted: Mon Aug 15, 2005 12:49 am
by Morlan
Hi,

I have done a search and haven't found any answers.

I have set up a new group called 'Editors' and have given it the 'Modify Any Page' permission only. However, when I log in under this group, the 'Extensions' menu is still visable.

Is there a way to hide this menu as users will keep asking me what it's for! All they need to do is edit content.

p.s, What a fantastic CMS :) It's soooo easy to use. Thanks guys.

Re: Remove 'Extensions' menu from control panel

Posted: Mon Aug 15, 2005 3:13 am
by Ted
Hmm.  I'm not sure about this one.  I'll have to ask sjg, since he did most of the showing/hiding stuff.  I'm sure it wouldn't be that hard to fix.

Re: Remove 'Extensions' menu from control panel

Posted: Tue Aug 16, 2005 4:22 am
by Morlan
wishy wrote: Hmm.  I'm not sure about this one.  I'll have to ask sjg, since he did most of the showing/hiding stuff.  I'm sure it wouldn't be that hard to fix.
Thanks wishy, Much appreciated :) It's just that it says "Modules, tags, and other assorted fun". No doubt users will start poking around and wasting time!

Re: Remove 'Extensions' menu from control panel

Posted: Thu Aug 18, 2005 5:31 am
by liquid
Any word on this? I also want to make sure that my users don't poke around in places they shouldn't. :)

Re: Remove 'Extensions' menu from control panel

Posted: Thu Aug 18, 2005 1:41 pm
by Ted
I'm going to try to hit up SjG before he goes on vacation in a couple of days.  Hopefully it's an easy fix, but I don't totally understand the admin console code these days.

Re: Remove 'Extensions' menu from control panel

Posted: Thu Aug 18, 2005 5:16 pm
by sjg
The current system displays the "Extensions" menu if the user has permissions *or* there is more than one module installed. The logic on that was that a user may have permissions to use a specific module (which would show up in the Extensions section) but not permission to handle modules/user-tags in general.

I'll talk to Wishy about the right approach here. But the "easy" hack fix is to edit lib/classes/class.admintheme.inc.php and change lines 317-319 from:

Code: Select all

        $this->perms['extensionsPerms'] = $this->perms['codeBlockPerms'] |
            $this->perms['modulePerms'] |
            (isset($this->sectionCount['extensions']) && $this->sectionCount['extensions'] > 0);

to

Code: Select all

        $this->perms['extensionsPerms'] = $this->perms['codeBlockPerms'] |
            $this->perms['modulePerms'];
Why I was using bitwise ORs on booleans is a mystery to me now. I suppose it works, but it was a weird decision to make. Maybe I should update this for the next release...

Re: Remove 'Extensions' menu from control panel

Posted: Thu Aug 18, 2005 5:29 pm
by liquid
I'll take the "easy" fix for now. :) Thanks so much for taking the time to post this!

Re: Remove 'Extensions' menu from control panel

Posted: Thu Aug 18, 2005 9:41 pm
by Morlan
That worked a treat, thanks sjg :)

Re: Remove 'Extensions' menu from control panel

Posted: Wed Nov 09, 2005 4:02 pm
by J-P
sjg wrote: The current system displays the "Extensions" menu if the user has permissions *or* there is more than one module installed. The logic on that was that a user may have permissions to use a specific module (which would show up in the Extensions section) but not permission to handle modules/user-tags in general.

I'll talk to Wishy about the right approach here. But the "easy" hack fix is to edit lib/classes/class.admintheme.inc.php and change lines 317-319 from:

Code: Select all

        $this->perms['extensionsPerms'] = $this->perms['codeBlockPerms'] |
            $this->perms['modulePerms'] |
            (isset($this->sectionCount['extensions']) && $this->sectionCount['extensions'] > 0);

to

Code: Select all

        $this->perms['extensionsPerms'] = $this->perms['codeBlockPerms'] |
            $this->perms['modulePerms'];
Why I was using bitwise ORs on booleans is a mystery to me now. I suppose it works, but it was a weird decision to make. Maybe I should update this for the next release...
I tried this, but no succes. Is it possible this don't work with the latest version?

Re: Remove 'Extensions' menu from control panel

Posted: Thu Aug 10, 2006 2:44 pm
by liquid
J-P wrote: I tried this, but no succes. Is it possible this don't work with the latest version?
I just did it with 1.0beta3, with no problems. The line numbers are now 336 to 338, though.

Re: Remove 'Extensions' menu from control panel

Posted: Sat Aug 12, 2006 2:16 pm
by larskong
Hi,

I just did this on the 1.0 beta4 and it worked fine.

I had to check the permissions for the editor group and remove the permission for "Modify User-defined Tags".
And then the menu "extensions" disappeared from the control panel, when logged in as editor user.

best regards / Lars

Re: Remove 'Extensions' menu from control panel

Posted: Tue Jan 01, 2008 2:04 pm
by generic
this worked better for me:

in class.admintheme.inc.php

around line 775 change the permission of the extensions to something else you would want it to be allowed under like managing users as i did inthe example

Code: Select all

'description'=>lang('extensionsdescription'),'show_in_menu'=>$this->HasPerm('extensionsPerms')),
change it to for example:

Code: Select all

'description'=>lang('extensionsdescription'),'show_in_menu'=>$this->HasPerm('userPerms')),
which will now only show the extensions menu if the user has permission to manage users.