concrete/src/Entity/OAuth/ScopeRepository.php
public function finalizeScopes(
        array $scopes,
        $grantType,
        ClientEntityInterface $clientEntity,
        $userIdentifier = null
    ) {
        $app = Facade::getFacadeApplication();
        $allowedScopes = $app->make('config')->get('app.api.scopes');
        $winnowed = [];
        foreach ($scopes as $scope) {
            if (in_array($scope->getIdentifier(), $allowedScopes)) {
                $winnowed[] = $scope;
            }
        }

        return $winnowed;
    }
public function finalizeScopes(
        array $scopes,
        $grantType,
        ClientEntityInterface $clientEntity,
        $userIdentifier = null
    ) {
        $app = Facade::getFacadeApplication();
        $allowedScopes = $app->make('config')->get('app.api.scopes');
        $winnowed = [];
        foreach ($scopes as $scope) {
            if (in_array($scope->getIdentifier(), $allowedScopes)) {
                $winnowed[] = $scope;
            }
        }

        return $winnowed;
    }
public function finalizeScopes ( array $ scopes , $ grantType , ClientEntityInterface $ clientEntity , $ userIdentifier = null ) { $ app = Facade :: getFacadeApplication ( ) ; $ allowedScopes = $ app -> make ( 'config' ) -> get ( 'app.api.scopes' ) ; $ winnowed = [ ] ; foreach ( $ scopes as $ scope ) { if ( in_array ( $ scope -> getIdentifier ( ) , $ allowedScopes ) ) { $ winnowed [ ] = $ scope ; } } return $ winnowed ; }
Given a client, grant type and optional user identifier validate the set of scopes requested are valid and optionally
append additional scopes or remove requested scopes.

@param ScopeEntityInterface[] $scopes
@param string $grantType
@param ClientEntityInterface $clientEntity
@param null|string $userIdentifier

@return ScopeEntityInterface[]
Given a client grant type and optional user identifier validate the set of scopes requested are valid and optionally append additional scopes or remove requested scopes .