[Fix] Notification only visible to all if forAll

otherwise role, etc. must be set and match
This commit is contained in:
Robert von Burg 2024-03-07 12:26:51 +01:00
parent 2914889172
commit 125dfe9b03
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
1 changed files with 2 additions and 2 deletions

View File

@ -44,11 +44,11 @@ public class DefaultNotificationsPolicy extends NotificationsPolicy {
protected boolean isForRole(Resource notification) {
List<String> roles = notification.getStringList(BAG_VISIBILITY, PARAM_ROLES);
return roles.isEmpty() || roles.stream().anyMatch(r -> tx().getCertificate().hasRole(r));
return roles.stream().anyMatch(r -> tx().getCertificate().hasRole(r));
}
protected boolean isForGroup(Resource notification) {
List<String> groups = notification.getStringList(BAG_VISIBILITY, PARAM_GROUPS);
return groups.isEmpty() || groups.stream().anyMatch(r -> tx().getCertificate().hasGroup(r));
return groups.stream().anyMatch(r -> tx().getCertificate().hasGroup(r));
}
}