function subuser_user_create_access in Subuser 6
Access callback for user/%user/subuser/create.
If user has 'administer users' or 'administer subusers' or if they have 'create subser' and they are adding a subuser to their own account then allow access.
Parameters
$account: User object representing the account which subusers will be added to.
Return value
TRUE if access is granted otherwise FALSE.
1 call to subuser_user_create_access()
- subuser_user in ./
subuser.module - Implementation of hook_user().
1 string reference to 'subuser_user_create_access'
- subuser_menu in ./
subuser.module - Implementation of hook_menu().
File
- ./
subuser.module, line 143 - Allows users of a particular role to create sub user account in another role.
Code
function subuser_user_create_access($account) {
global $user;
if (user_access('administer users') || (user_access('create subuser') || user_access('administer subusers')) && $account->uid == $user->uid) {
return TRUE;
}
return FALSE;
}