You are here

function user_patterns_export_all_permissions in Patterns 7

Same name and namespace in other branches
  1. 7.2 patterns_components/components/user.inc \user_patterns_export_all_permissions()
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 71

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',
        'rid' => $rid,
        'value' => $permissions,
      ),
    );
    array_push($result, $action);
  }
  return $result;
}