public function isAllow(GrantableInterface $grantable, $action) { if ($grantable instanceof UserRestrictionCapabilitiesInterface) { if ($grantable->isSuperAdmin()) { return true; } } return parent::isAllow($grantable, $action); }
/** * @param GrantableInterface $grantable */ public function initialize(GrantableInterface $grantable) { $this->resolver->setRoles($grantable->roles); parent::initialize($grantable); }
/** * @param PermissionResolver $resolver * @param RoleRepository $repository */ public function __construct(PermissionResolver $resolver, RoleRepository $repository) { $this->repository = $repository; parent::__construct($resolver); }