コード例 #1
0
ファイル: User.php プロジェクト: ndrx-io/elude
 public function isAllow(GrantableInterface $grantable, $action)
 {
     if ($grantable instanceof UserRestrictionCapabilitiesInterface) {
         if ($grantable->isSuperAdmin()) {
             return true;
         }
     }
     return parent::isAllow($grantable, $action);
 }
コード例 #2
0
ファイル: Group.php プロジェクト: ndrx-io/elude
 /**
  * @param GrantableInterface $grantable
  */
 public function initialize(GrantableInterface $grantable)
 {
     $this->resolver->setRoles($grantable->roles);
     parent::initialize($grantable);
 }
コード例 #3
0
ファイル: Role.php プロジェクト: ndrx-io/elude
 /**
  * @param PermissionResolver $resolver
  * @param RoleRepository     $repository
  */
 public function __construct(PermissionResolver $resolver, RoleRepository $repository)
 {
     $this->repository = $repository;
     parent::__construct($resolver);
 }