Remove 'Extensions' menu from control panel

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
Morlan

Remove 'Extensions' menu from control panel

Post 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.
Last edited by Morlan on Mon Aug 15, 2005 12:53 am, edited 1 time in total.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: Remove 'Extensions' menu from control panel

Post 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.
Morlan

Re: Remove 'Extensions' menu from control panel

Post 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!
liquid
Forum Members
Forum Members
Posts: 59
Joined: Sun Aug 07, 2005 10:20 pm

Re: Remove 'Extensions' menu from control panel

Post by liquid »

Any word on this? I also want to make sure that my users don't poke around in places they shouldn't. :)
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: Remove 'Extensions' menu from control panel

Post 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.
User avatar
sjg
Power Poster
Power Poster
Posts: 310
Joined: Thu Jan 27, 2005 5:11 pm
Location: Los Angeles, CA

Re: Remove 'Extensions' menu from control panel

Post 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...
Many modules available from the http://dev.cmsmadesimple.org
The CMS Made Simple Developer Cookbook is now available from Packt Publishers!
liquid
Forum Members
Forum Members
Posts: 59
Joined: Sun Aug 07, 2005 10:20 pm

Re: Remove 'Extensions' menu from control panel

Post by liquid »

I'll take the "easy" fix for now. :) Thanks so much for taking the time to post this!
Morlan

Re: Remove 'Extensions' menu from control panel

Post by Morlan »

That worked a treat, thanks sjg :)
J-P

Re: Remove 'Extensions' menu from control panel

Post 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?
liquid
Forum Members
Forum Members
Posts: 59
Joined: Sun Aug 07, 2005 10:20 pm

Re: Remove 'Extensions' menu from control panel

Post 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.
larskong

Re: Remove 'Extensions' menu from control panel

Post 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
generic
New Member
New Member
Posts: 6
Joined: Fri Feb 09, 2007 8:55 pm

Re: Remove 'Extensions' menu from control panel

Post 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.
Locked

Return to “CMSMS Core”