예제 #1
0
 public function __construct(PermissionsResourceInterface $resource, $permission)
 {
     $this->resource = $resource;
     $this->userIds = $resource->getPermissionsUserIds();
     $this->permission = $permission;
 }
예제 #2
0
 /**
  * Gets/Generates the resource id.
  *
  * @param string|UserInterface|PermissionsResourceInterface $resource
  *
  * @return string
  */
 protected function getResourceId($resource)
 {
     if ($resource instanceof PermissionsResourceInterface) {
         return $resource->getPermissionsResourceId();
     }
     if ($resource instanceof UserInterface) {
         return 'user:'******'user:' . $resource;
 }