Closed (fixed)
Project:
Permissions API
Version:
6.x-2.11
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
9 Aug 2011 at 19:54 UTC
Updated:
17 Apr 2012 at 21:10 UTC
Looking for a way to accomplish the command (via drush) to give permissions to all roles.
Right now if I use: drush perm-grant 'anonymous user' 'access devel information' I will end up with only that role having that permission. In fact, it even removed that permission from the Admin Role since there isn't a normal permission save to re-grant that role all permissions.
drush perm-grant all 'access devel information'Extra note: Seems the output info on a failed permissions grant isn't quite right...
After trying: drush perm-grant all 'access devel information'
Get back:
WD permissions_api: permissions_grant_permissions: failed to get role .
Specified Permissions granted to all.
After trying: drush perm-grant 'access devel information'
Get back:
WD permissions_api: permissions_grant_permissions: failed to get role .
Specified Permissions granted to access devel information.
Comments
Comment #1
ebeyrent commentedComment #2
doublejosh commentedCould it also/instead be possible to include multiple roles in a permissions drush command?
Comment #3
ebeyrent commentedHere's a list of all the actions it seems that Permissions API ought to support and expose via Drush.
grant N permissions to a role(s)
revoke N permissions from a role(s)
grant ALL permissions to a role(s)
revoke N permissions from a role(s)
grant N permissions to ALL roles
revoke N permissions from ALL roles
grant ALL permissions provided by a module to a role(s)
revoke ALL permissions provided by a module from a role(s)
grant ALL permissions a role has to another role(s)
revoke ALL permissions a role has from another role(s)
Does that cover all the use cases?
Comment #4
doublejosh commentedThis is beyond what I was asking, but I'm sure those would all be useful.
Some of these require a major change in that N values are allowed.
The one case I was interested in is this:
grant N permissions to ALL rolesHowever it would be faster like this:
grant ALL permissions provided by a module to a role(s) to ALL role(s)....which isn't in the list.
I'd want to use it like this:
drush perm-grant all-mod devel allOr like this:
drush perm-grant all 'access devel information' 'display source code' 'switch users'(in a dev environment of course)
However this might be super useful when deploying a new module to a number of Aegir sites along with required permissions.
BTW: "grant ALL permissions to a role(s)" would be covered by Admin Role, but no use excluding because of that.
Comment #5
ebeyrent commentedIf I understand correctly, you want to be able to grant all permissions provided by a module to all roles. In your example, you wish to grant all permissions provided by the Devel module to all roles.
Is that correct?
grant N permissions to a role(s)
revoke N permissions from a role(s)
grant ALL permissions to a role(s)
revoke N permissions from a role(s)
grant N permissions to ALL roles
revoke N permissions from ALL roles
grant ALL permissions provided by a module to a role(s)
revoke ALL permissions provided by a module from a role(s)
grant ALL permissions provided by a module to ALL roles
revoke ALL permissions provided by a module from ALL roles
grant ALL permissions a role has to another role(s)
revoke ALL permissions a role has from another role(s)
Comment #6
doublejosh commentedYeah that was my intension.
Comment #7
ebeyrent commentedI have added this functionality in the 3.x branch. I've refactored much of the drush interface to provide this functionality:
Comment #8
ebeyrent commentedComment #9
doublejosh commentedThis is wonderful BTW.
Comment #9.0
doublejosh commentedstrikethrough claim about removing permissions