Great work,
Please add these as well:

  $items['admin/people'] = array(
    'title' => 'People', 
    'description' => 'Manage user accounts, roles, and permissions.', 
    'page callback' => 'user_admin', 
    'page arguments' => array('list'), 
    'access arguments' => array('User Settings'),
    'file' => 'user.admin.inc',
    'file path' => drupal_get_path('module', 'user'),
    'weight' => -4, 
  );
  
  $items['admin/people/create'] = array(
    'title' => 'Add user', 
    'page arguments' => array('create'), 
    'access arguments' => array('User Settings'),
  );
  
  $items['admin/people/people'] = array(
    'title' => 'List', 
    'description' => 'Find and manage people interacting with your site.', 
    'access arguments' => array('User Settings'), 
    'weight' => -10, 
    'file' => 'user.admin.inc',
    'file path' => drupal_get_path('module', 'user'),
  );

Regards.

Comments

tchurch’s picture

Status: Active » Postponed (maintainer needs more info)

Can you give us more information about what this new code is for? What is it meant to do?

I have a feeling that these restrictions are already provided through other modules.

Thanks

sa3er’s picture

Sure,

Here is the whole story,
Let's say I've given the "administer users" permission to someone. I've logged in with his ID and just figured out he has more than needed privilege.

So I just installed your module and it did a great job on blocking "admin/config/people/accounts" but the user still got access to "admin/people/create" where he could create new users while only admin had "new user creation" privilege. Also the URL "admin/people/" gave the user a list of whole registered users on site where he could mass edit/block/cancel/remove/assignrole.

I just wanted that specific user to be able to edit username/password and some other custom fields of other users I had made. That's all.

at the end I built up a Views based page with a list of all users and just an edit button in front of each one.

tchurch’s picture

Assigned: Unassigned » tchurch
Status: Postponed (maintainer needs more info) » Active

I can look at adding a new permission for Controlling "add user" using the code you provided (although there would also be a new permission).

I'm still not sure about the other one though. I will have a think about it. There might be other modules that do this (I try and control these functions already but mainly in Drupal 6. I've just started using Drupal 7 for my new websites now).

tchurch’s picture

Assigned: tchurch » Unassigned
Status: Active » Closed (won't fix)

After looking into this more, I think that the modules "administer users by role" and "role delegation" might do the job instead.

If an update to this module is still needed after this, we can discuss it.