Fix management of predicate security on DELETE
@@ -1618,6 +1618,20 @@ public class OSecurityShared implements OSecurityInternal {
} else {
className = ((OElement) record).getSchemaType().map(x -> x.getName()).orElse(null);
}
+
+ if (roleHasPredicateSecurityForClass != null) {
+ for (OSecurityRole role : session.getUser().getRoles()) {
+ Map<String, Boolean> roleMap = roleHasPredicateSecurityForClass.get(role.getName());
+ if (roleMap == null) {
+ return true; // TODO hierarchy...?
+ }
+ Boolean val = roleMap.get(className);
+ if (!(Boolean.TRUE.equals(val))) {
+ return true; // TODO hierarchy...?
+ }
+ }
+ }
+
OBooleanExpression predicate = null;
if (className != null) {
predicate =
