Skip to content

Commit 1a77663

Browse files
committed
fixed getIdsWithReadEntityPrivilege for overall privileges
1 parent b1a04a5 commit 1a77663

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/ch/ethz/seb/sps/server/servicelayer/impl/UserServiceImpl.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,11 @@ public boolean hasGrant(final UserInfo user, final PrivilegeType privilegeType,
187187
public Result<Set<Long>> getIdsWithReadEntityPrivilege(final EntityType entityType) {
188188
return Result.tryCatch(() -> {
189189
final String userUUID = this.getCurrentUser().uuid();
190+
191+
// check if user has overall read privileges on the entity type
192+
if (hasGrant(PrivilegeType.READ, entityType)) {
193+
return Collections.emptySet();
194+
}
190195

191196
// if owned entity type. get all owned entity id's if owned entity
192197
final Set<Long> ownedEntityIds = new HashSet<>();

0 commit comments

Comments
 (0)