private function checkRoleGlobalPermission($roleName, $permissionName)
    {
        $roles = $this->getRolesByGlobalPermission($permissionName);
        if (!is_array($roles)) {
            // We log it, unless the permission name is 'root'.
            if ($roleName !== self::ROLE_ROOT) {
                $this->app['logger.system']->warn(
                    "Configuration error: Permission '$permissionName' is not granted to any roles. You should add a role for this permission to <tt>permissions.yml</tt>.",
                    ['event' => 'authentication']
                );
            }

            return false;
        }

        return in_array($roleName, $roles);
    }
private function checkRoleGlobalPermission($roleName, $permissionName)
    {
        $roles = $this->getRolesByGlobalPermission($permissionName);
        if (!is_array($roles)) {
            // We log it, unless the permission name is 'root'.
            if ($roleName !== self::ROLE_ROOT) {
                $this->app['logger.system']->warn(
                    "Configuration error: Permission '$permissionName' is not granted to any roles. You should add a role for this permission to <tt>permissions.yml</tt>.",
                    ['event' => 'authentication']
                );
            }

            return false;
        }

        return in_array($roleName, $roles);
    }
private function checkRoleGlobalPermission ( $ roleName , $ permissionName ) { $ roles = $ this -> getRolesByGlobalPermission ( $ permissionName ) ; if ( ! is_array ( $ roles ) ) { // We log it, unless the permission name is 'root'. if ( $ roleName !== self :: ROLE_ROOT ) { $ this -> app [ 'logger.system' ] -> warn ( "Configuration error: Permission '$permissionName' is not granted to any roles. You should add a role for this permission to <tt>permissions.yml</tt>." , [ 'event' => 'authentication' ] ) ; } return false ; } return in_array ( $ roleName , $ roles ) ; }
Check if a given role has the specified permission.

@param string $roleName
@param string $permissionName

@return bool
Check if a given role has the specified permission .