You are here

function security_review_role_permission in Security Review 6

Same name and namespace in other branches
  1. 7 security_review.inc \security_review_role_permission()

Helper function checks if role has been granted a permission.

File

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

Code

function security_review_role_permission($rid, $permission) {
  $return = FALSE;
  $result = db_fetch_array(db_query("SELECT perm FROM {permission} WHERE rid = %d", $rid));
  if ($result['perm'] && strpos($result['perm'], $permission) !== FALSE) {
    $return = TRUE;
  }
  return $return;
}