Skip to content

Commit

Permalink
feat: update subject to expose id + fix search impl
Browse files Browse the repository at this point in the history
  • Loading branch information
matteo-s committed Oct 24, 2024
1 parent fd67785 commit 286b64b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public List<Subject> searchSubjects(String realm, String q) {
realm,
q
)
: Collections.emptyList();
: subjectRepository.findByRealm(realm);

return subjects.stream().map(s -> toSubject(s)).collect(Collectors.toList());
}
Expand Down Expand Up @@ -379,7 +379,7 @@ public List<GrantedAuthority> updateAuthorities(String uuid, String realm, Colle
List<SubjectAuthorityEntity> oldRoles = authorityRepository.findBySubjectAndRealm(uuid, realm);

// unpack roles
Set<SubjectAuthorityEntity> newRoles = roles
Set<SubjectAuthorityEntity> newRoles = roles == null ? Collections.emptySet() : roles
.stream()
.map(r -> {
SubjectAuthorityEntity re = new SubjectAuthorityEntity(uuid);
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/it/smartcommunitylab/aac/model/Subject.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ public String getSubjectId() {
return subjectId;
}

public String getId() {
return getSubjectId();
}

public String getRealm() {
return realm;
}
Expand Down

0 comments on commit 286b64b

Please sign in to comment.