示例#1
0
 /**
  * Clear all ACL settings before starting tests.
  */
 public static function setUpBeforeClass()
 {
     foreach (AclResource::find() as $resource) {
         $resource->delete();
     }
     foreach (AclRole::find() as $role) {
         $role->delete();
     }
     $resource = new AclResource();
     $resource->create(['name' => Resource::WILDCARD, 'description' => 'All in all (built-in)']);
     (new AclResourceAccess())->create(['name' => Resource::ACCESS_WILDCARD, 'description' => 'All in all (built-in)', 'acl_resource_id' => $resource->id]);
 }
示例#2
0
文件: Mysql.php 项目: vegas-cmf/acl
 /**
  * @return mixed
  */
 public function removeResources()
 {
     foreach (AclResource::find() as $resource) {
         $resource->delete();
     }
 }