var $beforeFilter = array('checkAccessA'); * * @author unigue__ * @version 1.0 * @compability Developed for Cake 1.1.15.5144, dont know does it work on 1.2 * @see SimpleAcl-component * @see Cakes acl-tutorial on http://manual.cakephp.org/chapter/acl */ function checkAccessA() { if(empty($this->params['controller']) || empty($this->params['action'])) { return; } else if (!empty($this->params) && !empty($this->User)) { // Setting ups for SimpleAcl $settings = array( "table_prefix" => $this->table_prefix, // Needed "case_sensitive" => true, // Unnecessary others are already in SimpleAcl "acos_table" => "acos", "aros_table" => "aros", "axos_table" => "axos", "arosacos_table" => "aros_acos", "main_aco" => "main", "main_aro" => "users_maingroup", "security_level" => 1, "cut_admin_off" => true ); // Initialization $this->SimpleAcl->init($settings, $this->User, $this->params); // Finally access or not $access = $this->SimpleAcl->check($this->Session->read('User.user_name')); /** * If no access, redirect to login or whatever * Normally user cant get 0 if he's following showed links properly, * otherwise he's hijacking for a weak spots or smt. * Again put your own logic here */ if(!$access) { $this->flash("You need to login first.", "/Users/login", 1); exit; } } else { $this->flash("You need to login first.", "/Users/login", 1); exit; } } } ?>