function drupal_is_denied in Drupal 4
Same name and namespace in other branches
- 5 includes/bootstrap.inc \drupal_is_denied()
- 6 includes/bootstrap.inc \drupal_is_denied()
- 7 includes/bootstrap.inc \drupal_is_denied()
Perform an access check for a given mask and rule type. Rules are usually created via admin/access/rules page.
4 calls to drupal_is_denied()
- user_admin_access_check_submit in modules/
user.module - user_login_validate in modules/
user.module - _drupal_bootstrap in includes/
bootstrap.inc - _user_edit_validate in modules/
user.module
File
- includes/
bootstrap.inc, line 755 - Functions that need to be loaded on every Drupal request.
Code
function drupal_is_denied($type, $mask) {
$allow = db_fetch_object(db_query("SELECT * FROM {access} WHERE status = 1 AND type = '%s' AND LOWER('%s') LIKE LOWER(mask)", $type, $mask));
$deny = db_fetch_object(db_query("SELECT * FROM {access} WHERE status = 0 AND type = '%s' AND LOWER('%s') LIKE LOWER(mask)", $type, $mask));
return $deny && !$allow;
}