You are here

function security_review_trusted_roles in Security Review 7

Same name and namespace in other branches
  1. 6 security_review.inc \security_review_trusted_roles()

Helper function for assumed trusted roles.

1 call to security_review_trusted_roles()
security_review_check_name_passwords in ./security_review.inc

File

./security_review.inc, line 895
Stand-alone security checks and review system.

Code

function security_review_trusted_roles() {
  $trusted_roles = array();
  $untrusted_roles = security_review_untrusted_roles();
  $results = db_query('SELECT rid, name FROM {role} WHERE rid NOT IN (:rids)', array(
    ':rids' => $untrusted_roles,
  ));
  foreach ($results as $role) {
    $trusted_roles[$role->rid] = $role->name;
  }
  return array_filter($trusted_roles);
}