AdminScope example

$isAdmin = $this->connection->createQueryBuilder()
            ->select('admin')
            ->from('user')
            ->where('id = UNHEX(:accessKey)')
            ->setParameter('accessKey', $userIdentifier)
            ->setMaxResults(1)
            ->executeQuery()
            ->fetchOne();

        if ($isAdmin) {
            $scopes[] = new AdminScope();
        }

        return $this->uniqueScopes($scopes);
    }

    private function uniqueScopes(array $scopes): array
    {
        $uniqueScopes = [];

        /** @var ScopeEntityInterface $scope */
        foreach ($scopes as $scope) {
            
Home | Imprint | This part of the site doesn't use cookies.