KEYCLOAK-569 Check application roles for scope
This commit is contained in:
1 parent
d2b42e3843
commit
213b685b43
4 files changed
+58
-2
No files matched your search
+14
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user