protected function allows($permissionName)
    {
        foreach ($this->getMatchingPermissions($permissionName) as $key)
        {
            /** @var Permission $permission */
            $permission = $this->permissions->get($key);

            if ($permission->isAllowed())
            {
                return true;
            }
        }

        return false;
    }
protected function allows($permissionName)
    {
        foreach ($this->getMatchingPermissions($permissionName) as $key)
        {
            /** @var Permission $permission */
            $permission = $this->permissions->get($key);

            if ($permission->isAllowed())
            {
                return true;
            }
        }

        return false;
    }
protected function allows ( $ permissionName ) { foreach ( $ this -> getMatchingPermissions ( $ permissionName ) as $ key ) { /** @var Permission $permission */ $ permission = $ this -> permissions -> get ( $ key ) ; if ( $ permission -> isAllowed ( ) ) { return true ; } } return false ; }
Check if the given permission is allowed.
Only explicitly allowed permissions will return true.

@param string $permissionName
@return bool
Check if the given permission is allowed . Only explicitly allowed permissions will return true .