Merge pull request #18 from battags/CASC-188

CASC-188 Provide Support for Wildcard Roles
This commit is contained in:
Marvin S. Addison 2012-09-21 06:51:16 -07:00
commit bc6229b00e
2 changed files with 7 additions and 0 deletions

View File

@ -73,6 +73,9 @@ public class AssertionCasRealmDelegate implements CasRealm {
/** {@inheritDoc} */
public boolean hasRole(final Principal principal, final String role) {
if ("*".equals(role)) {
return true;
}
return getRoleCollection(principal).contains(role);
}

View File

@ -109,6 +109,10 @@ public class PropertiesCasRealmDelegate implements CasRealm {
/** {@inheritDoc} */
public boolean hasRole(final Principal principal, final String role) {
if ("*".equals(role)) {
return true;
}
final Set<String> roles = this.roleMap.get(principal.getName());
return roles != null && roles.contains(role);