drupal_is_denied

Definition

drupal_is_denied($type, $mask)
includes/bootstrap.inc, line 755

Description

Perform an access check for a given mask and rule type. Rules are usually created via admin/access/rules page.

Code

<?php
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;
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.