Ejemplo n.º 1
0
 public static function createResource(App_Acl $acl, $resource)
 {
     $inherit = null;
     $parts = explode('<', $resource);
     $parts = array_filter(array_map('trim', $parts));
     $resource = $parts[0];
     if (!empty($parts[1])) {
         $inherit = $parts[1];
     }
     $acl->addResource($resource, $inherit);
 }
Ejemplo n.º 2
0
 public static function createResource(App_Acl $acl, $resource)
 {
     $inherit = null;
     if (is_object($resource)) {
         if (!isset($resource->name)) {
             throw new InvalidArgumentException("No resource name");
         }
         if (isset($resource->inherit)) {
             $inherit = $resource->inherit;
         }
         $resource = $resource->name;
     }
     $acl->addResource($resource, $inherit);
 }