public function isGranted($permission, $context = null)
    {
        $roles = $this->roleService->getIdentityRoles();

        if (empty($roles)) {
            return false;
        }

        if (!$this->rbac->isGranted($roles, $permission)) {
            return false;
        }

        if ($this->hasAssertion($permission)) {
            return $this->assert($this->assertions[(string) $permission], $context);
        }

        return true;
    }
public function isGranted($permission, $context = null)
    {
        $roles = $this->roleService->getIdentityRoles();

        if (empty($roles)) {
            return false;
        }

        if (!$this->rbac->isGranted($roles, $permission)) {
            return false;
        }

        if ($this->hasAssertion($permission)) {
            return $this->assert($this->assertions[(string) $permission], $context);
        }

        return true;
    }
public function isGranted ( $ permission , $ context = null ) { $ roles = $ this -> roleService -> getIdentityRoles ( ) ; if ( empty ( $ roles ) ) { return false ; } if ( ! $ this -> rbac -> isGranted ( $ roles , $ permission ) ) { return false ; } if ( $ this -> hasAssertion ( $ permission ) ) { return $ this -> assert ( $ this -> assertions [ ( string ) $ permission ] , $ context ) ; } return true ; }
Check if the permission is granted to the current identity

@param string|PermissionInterface $permission
@param mixed                      $context
@return bool
Check if the permission is granted to the current identity