hasRole method
Check if token holder has specific role
Implementation
Future<bool> hasRole(
String token,
String role, {
String? resource,
Map<String, dynamic>? context,
}) async {
try {
final contextObj = await authorize(
token,
resource: resource,
context: context,
);
return contextObj.hasRole(role);
} on Exception {
return false;
}
}