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.

Comments

polynya’s picture

I have the same problem, although I don't see the PHP notice.

mr.moses’s picture

I 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'.

rooby’s picture

joshuautley’s picture

@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.

nicxvan’s picture

I 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.

nicxvan’s picture

StatusFileSize
new491 bytes

I 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.

rooby’s picture

The 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.

nicxvan’s picture

Do you want me to bring my patch to that issue?

rooby’s picture

Sure that would be good, thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.