KEYCLOAK-569 Check application roles for scope

This commit is contained in:
Stian Thorgersen committed 2014-07-21 13:50:27 +01:00
1 parent d2b42e3843
commit 213b685b43
4 files changed
+58 -2

No files matched your search

@@ -184,6 +184,20 @@ public class ApplicationAdapter extends ClientAdapter implements ApplicationMode
return roles;
}
@Override
public boolean hasScope(RoleModel role) {
if (super.hasScope(role)) {
return true;
}
Set<RoleModel> roles = getRoles();
if (roles.contains(role)) return true;
for (RoleModel mapping : roles) {
if (mapping.hasRole(role)) return true;
}
return false;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;