I'm trying to create a permission for adding users (so that I can grant users the ability to add users without giving them access to user settings and everything else that comes with the administer users permission). It doesn't seem to be working. I've tried adding the paths admin/people, admin/people/create, and user/*/edit. This lets me see the list of users and edit users, but not create new ones. When I go to admin/people/create, I just get kicked back to my own account page.
I also see "Notice: Trying to get property of non-object in config_perms_access_callback() (line 133 ..." not sure if it's related.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | [check_object_existence]-[1312446]-[6].patch | 491 bytes | nicxvan |
Comments
Comment #1
polynya commentedI have the same problem, although I don't see the PHP notice.
Comment #2
mr.moses commentedI was able to do something similar by giving 'administer users' permission and then adding Custom Permissions to block the things they shouldn't have, like creating a Custom Permission called 'administer account settings' for 'admin/config/people/accounts'.
Comment #3
rooby commentedRelated - #1904910: Add administer account settings permission
Comment #4
joshuautley commented@mr.moses - Your comment finally helped me understand this module so much better. It hadn't occurred to me to create a permission in order to deny that specific permission. Eureka! Thanks.
Comment #5
nicxvan commentedI added this permission, but also had to add the Administer users to get it to work which is unhelpful because users can then set their role to admin role and have all permissions.
Comment #6
nicxvan commentedI created a patch to remove the error on line 133.
It checks that the object exists before returning it. Not sure if it should have a then result such as return null.
Comment #7
rooby commentedThe problem with the create user page is that the user module uses a single user registration form for multiple purposes.
In the registration form code it then checks for admin permissions and kicks you out if you don't have access.
So as mentioned above, you must have the administer users permission to create users. You can then restrict other pages with this module as required.
As for the patch, that is a different issue to that of the title of this post and we need to keep one issue per issue.
Also, there is another issue open for that. See #1441692: Trying to get property of non-object in config_perms_access_callback() in config_perms\config_perms.module
The support request part of this is fixed.
Comment #8
nicxvan commentedDo you want me to bring my patch to that issue?
Comment #9
rooby commentedSure that would be good, thanks.