hasRoleForUser method
hasRoleForUser determines whether a user has a role.
name
the user.
role
the role.
return whether the user has the role.
Implementation
bool hasRoleForUser(String name, String role) {
var roles = getRolesForUser(name);
return roles.any((element) => element == role);
}