You are here

function _features_get_roles in Features 6

Represent the current state of permissions as a role name to role/perm array.

7 calls to _features_get_roles()
FeaturesUserTestCase::_test_user_permission in tests/features.test
user_permission_features_rebuild in includes/features.user.inc
Implementation of hook_features_rebuild(). Iterate through default permissions and update the permissions map.
user_role_features_export_options in includes/features.user.inc
Implementation of hook_features_export_options().
user_role_features_export_render in includes/features.user.inc
Implementation of hook_features_export_render().
user_role_features_rebuild in includes/features.user.inc
Implementation of hook_features_rebuild().

... See full list

File

./features.module, line 743
Module file for the features module, which enables the capture and management of features in Drupal. A feature is a collection of Drupal entities which taken together statisfy a certain use-case.

Code

function _features_get_roles() {
  $roles = array();
  $result = db_query("SELECT r.rid, r.name, p.perm FROM {role} r LEFT JOIN {permission} p ON r.rid = p.rid ORDER BY r.name");
  while ($row = db_fetch_object($result)) {
    $roles[$row->name] = array(
      'rid' => $row->rid,
      'perm' => explode(', ', $row->perm),
    );
  }
  return $roles;
}