You are here

function user_patterns_export_all_permissions in Patterns 7.2

Same name and namespace in other branches
  1. 7 patterns_components/components/user.inc \user_patterns_export_all_permissions()

Returns a set of PATTERNS_MODIFY actions ONLY with the whole set of roles currently stored in the system.

Parameters

array $args Set of arguments received from the form.:

string $result Current set of actions for the whole process.:

Return value

array $result Set of actions after performing the changes.

1 string reference to 'user_patterns_export_all_permissions'
user_patterns in patterns_components/components/user.inc
Implements hook_patterns() for the user module.

File

patterns_components/components/user.inc, line 103

Code

function user_patterns_export_all_permissions($args = NULL, &$result = NULL) {
  $roles = user_roles();
  $permissions = user_role_permissions($roles);
  $result = array();
  foreach ($permissions as $rid => $perms) {
    $permissions = array_keys($perms);
    $action = array(
      PATTERNS_MODIFY => array(
        'tag' => 'permission',
        'role' => $roles[$rid],
        'value' => $permissions,
      ),
    );
    array_push($result, $action);
  }
  return $result;
}