The patch creates two new permissions in core: administer themes and administer modules. They are fairly self explanatory. Users with the 'administer themes' permission can get to admin/build/themes/* and users with the 'administer modules' permission can get to admin/build/modules/*
This patch also changes the method of display for the administration pages.
If a user has permission to, for example, administer modules, that user should be able to get to the administration page. Menu items for system.module that previously checked for 'access administration pages' now check for any of the administrative permissions to be enabled (see line 802 after applying the patch to see what permissions are checked)
| Comment | File | Size | Author |
|---|---|---|---|
| #31 | 446666_31.patch | 10.58 KB | cweagans |
| #28 | 446666_28.patch | 10.59 KB | cweagans |
| #27 | 446666_27.patch | 8.17 KB | cweagans |
| #26 | 446666_26.patch | 8.1 KB | cweagans |
| #24 | 446666_24.patch | 7.96 KB | cweagans |
Comments
Comment #2
Anonymous (not verified) commentedI like this idea. You'll need to update the tests to get them to pass.
Comment #3
cweagansUpdate the tests? How do I do that?
Comment #4
sun"access administration pages" you have to leave as is. It's a completely different permission than "administer site configuration", for good reason.
Comment #5
cweagansWell sure, but it's kind of a usability thing. Why should an admin have to assign two separate permissions to someone if they want to allow that user to administer the modules on the site. What is the reasoning to have two permissions?
Comment #6
sun"access administration pages" grants access to admin/. There is more than administering modules and themes below admin/ - starting with the administration dashboard directly on the path "admin". Followed by administrative help pages, site reports, and arbitrary other stuff you may add via contributed or custom modules. Basically, you could say that it grants overall access to Drupal's back-end, while the back-end is whatever you want to have as back-end.
This permission exists on purpose, has nothing to do with the scope of this patch, and therefore you have to leave it alone.
Comment #7
cweagansAlright, I removed that part of the patch.
Comment #9
joachim commentedTo my surprise today I found that 'administer site configuration' allows a user to use the site while in maintenance mode, something I thought was only for UID 1. So that's something else to take into account if rethinking this permission.
Comment #10
sun@joachim: #201415: Add permission to access site in maintenance mode
Comment #11
cweagansIt took a while, but I finally got around to fixing the tests. On my machine, all tests pass, so let's hope it stays that way on the testing slaves =D
Comment #12
cweagansWoops....needs review >.<
Comment #14
cweagansOne more...
Comment #15
cweagansConversation with cwgordon7 in #drupal
cwgordon7: "Administer modules" is basically a permission that would allow a user to compromise a site. Why, then, should that be separate from "administer site configuration"?
cweagans: administer site configuration is a HUGE permission. There's so much stuff to it....it's ridiculous, really...I've got sites where I would want a user to be able to administer modules and themes, but not the rest of the stuff that administer site configuration opens up.
cwgordon7: cweagans: But why would anyone ever want to be enabling/disabling modules and not be able to configure them?
cwgordon7: I guess my complaint is mainly from a security standpoint - Drupal has had some negative attention due to there being more than one permission that can lead to complete administrative access of the site
cwgordon7: I'm reluctant at best to adding yet another site-compromising permission that people can easily mess up and assign to users without fully realizing the implications
cwgordon7: cweagans: Though I must say, I admire your efforts in the struggle against the test bot even if I'm not fully convinced by the patch yet
--cwgordon7 went offline at this point. Druplicon should have passed this message for me:
cweagans: a lot of modules have their own permission for allowing a user to configure that particular module (eg. the block module: administer blocks). The reason that I see for it is a case in which a Drupal installation is mostly managed by somebody that knows what they are doing, but wants to allow certain users to, for example, enable the blog module. Or the forum module. A case in which an admin can offload some of the responsibility of building the site to other capable people and not allow them to, for example, put the site into maintenance mode. (haha, you went offline just as I posted this)
Comment #16
tstoecklerFirst of all, with "administer permissions" there are already multiple permissions, that let you compromise the site.
That having been said, I don't think it makes sense to prevent people of delegating administrative tasks to trusted users only because people would start to use it unwisely. Doing that is not fixing the problem, and keeping Drupal less flexible at that.
The solution to people potentially handing out permissions without caution is educating them properly about what they are doing.
We already have security warnings in the description of the permissions, and I like that trend, but clearly this isn't enough. Maybe we should color the affected rows red and in the descriptions link to a help page which describes in which way you are shooting yourself in the foot if you proceed or something.
Anyways, that is for another issue, and from a conceptual POV it definitely makes sense to split the "administer site configuration" permission.
Comment #17
cweagansI couldn't agree with you more tstoeckler.
Also, splitting administer site configuration into 'administer site configuration', 'administer themes', and 'administer modules' is based on a conversation that I had with webchick in IRC. Initially, I thought that it would be a good idea to basically merge http://drupal.org/project/config_perms into core. webchick thought that this was way too granular for most people, hence the current patch.
Comment #19
cweagansHuh, the patch was fine before. Retest.
Comment #20
matt2000 commented+1
Comment #23
cweagansIt's not looking like I'm going to have time to update this patch to HEAD. If someone wants to take this on, that would be freaking awesome! 'administer site configuration' is a HUGE permission. Tagging with d7ux...this is very confusing for a new user ("Erm...that permission enables WHAT!?")
Comment #24
cweagansUpdated to head. Hope the tests pass..
Comment #25
sunThanks! Looks great!
1) Can we remove "site" from the title, please?
2) What about descriptions?
I'm on crack. Are you, too?
Comment #26
cweagansFixed both issues. A sidenote: the other system permissions don't have descriptions. They will need to be added in another issue.
Comment #27
cweagansOk, last one, I think.
I moved the administer modules permission above administer site configuration
Comment #28
cweagansLast one for real. Removed the descriptions for the new permissions...they are fairly self explanatory. #620446: Rewrite permission titles and descriptions is the issue that removed most of the descriptions.
Also, I think I fixed the tests.
Comment #29
matt2000 commentedWhy do color tests still require administer site config?
This review is powered by Dreditor.
Comment #30
yoroy commentedI like this patch. The offloading of responsibilities that it will allow is a good thing to have, I can see the more complex site workflows benefit from this added granularity. That this is about really high-power permissions is not necessarily something that should stop us from doing it. To the contrary, anything that keeps you from having to grant the really big 'administer site configuration' permission is a good thing. Anyway, +1 from UX perspective as well
Comment #31
cweagansoh, you're right matt2000
Comment #32
matt2000 commentedLooks good to me.
Comment #33
sunIndeed!
Comment #34
dries commentedCommitted to CVS HEAD. Thanks.