authorize<TUser, TResource> method
Implementation
Future<void> authorize<TUser, TResource>(
TUser user,
String action,
TResource resource,
) async {
final DVApiScopeRefused? refused =
_outsideScopes<TResource>(user, action);
if (refused != null) throw refused;
if (!await can<TUser, TResource>(user, action, resource)) {
throw StateError('Action "$action" is not authorized for $TResource.');
}
}