Search in sources :

Example 1 with Authorized

use of com.bakdata.conquery.models.auth.permissions.Authorized in project conquery by bakdata.

the class TokenScopedUser method isPermitted.

@Override
public boolean[] isPermitted(List<? extends Authorized> authorized, Ability ability) {
    final EnumSet<Ability> abilitySet = EnumSet.of(ability);
    boolean[] ret = new boolean[authorized.size()];
    for (int i = 0; i < ret.length; i++) {
        Authorized object = authorized.get(i);
        ret[i] = tokenContext.isCoveredByScopes(object.createPermission(abilitySet)) && delegate.isPermitted(object, ability);
    }
    return ret;
}
Also used : Ability(com.bakdata.conquery.models.auth.permissions.Ability) Authorized(com.bakdata.conquery.models.auth.permissions.Authorized)

Aggregations

Ability (com.bakdata.conquery.models.auth.permissions.Ability)1 Authorized (com.bakdata.conquery.models.auth.permissions.Authorized)1