/** * sets the {@link $_levels} property * should be defined as (all values should be unique): * array( * 'root' => array('value' => 1) * 'admin' => array('value' => 2) * 'guest' => array('value' => 4) * ) * * @param array $access_levels * @access public * @static * @return void */ public static function set(array $access_levels = array()) { self::$_levels = $access_levels; }
/** * utility method to test if the user is a certain access level. Allows for multiple arguments. Will return true if any of the arguments evaluate to true * example: System_Session_Controller::is('admin', 8, 'root'); //would check to see if the user is an admin, access_level 8, or root user * * @access public * @static * @return boolean */ public static function is() { $access_levels = func_get_args(); $passed = false; foreach ($access_levels as $key => $acl) { if (System_Security_Access_Level::is($acl)) { $passed = true; break; } } return $passed; }