/** * 用户 acl对象初始化 * @return acl */ public static function acl_init() { /* 用户详情 */ $manager = role::get_manager(); $username = $manager["username"]; $action_resourses = role::get_action_resources(); // Role 权限注册表 $acl = Acl::instance(); $acl->add_role($username); for ($i = 0; $i < count($action_resourses); $i++) { $acl->allow($username, null, $action_resourses[$i]); } self::_cache($acl); return $acl; }