authScimScopesAllow function
Whether granted permits every exact scope in requested.
Implementation
bool authScimScopesAllow(
Iterable<AuthScimScope> granted,
Iterable<AuthScimScope> requested,
) {
final values = granted.toSet();
return requested.every(
(scope) =>
values.contains(scope) ||
scope == AuthScimScope.usersRead &&
values.contains(AuthScimScope.usersWrite) ||
scope == AuthScimScope.groupsRead &&
values.contains(AuthScimScope.groupsWrite),
);
}