You are here

function security_review_role_permission in Security Review 7

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

Check if role has been granted a permission.

File

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

Code

function security_review_role_permission($rid, $permission) {
  $return = FALSE;
  $result = db_select('role_permission', 'p')
    ->fields('p', array(
    'permission',
  ))
    ->condition('rid', $rid)
    ->execute()
    ->fetchField();
  if ($result['permission'] && strpos($result['permission'], $permission) !== FALSE) {
    $return = TRUE;
  }
  return $return;
}