function hook_rules_config_access
Control access to Rules configurations.
Modules may implement this hook if they want to have a say in whether or not a given user has access to perform a given operation on a Rules configuration.
Parameters
string $op: The operation being performed. One of 'view', 'create', 'update' or 'delete'.
$rules_config: (optional) A Rules configuration to check access for. If nothing is given, access for all Rules configurations is determined.
$account: (optional) The user to check for. If no account is passed, access is determined for the current user.
Return value
bool|null Return TRUE to grant access, FALSE to explicitly deny access. Return NULL or nothing to not affect the operation. Access is granted as soon as a module grants access and no one denies access. Thus if no module explicitly grants access, access will be denied.
See also
Related topics
1 function implements hook_rules_config_access()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- rules_rules_config_access in ./
rules.module - Implements hook_rules_config_access().
1 invocation of hook_rules_config_access()
- rules_config_access in ./
rules.module - Access callback for dealing with Rules configurations.
File
-
./
rules.api.php, line 1093
Code
function hook_rules_config_access($op, $rules_config = NULL, $account = NULL) {
// Instead of returning FALSE return nothing, so others still can grant
// access.
if (isset($rules_config) && $rules_config->owner == 'mymodule' && user_access('my modules permission')) {
return TRUE;
}
}