use of org.springframework.security.acls.domain.AbstractPermission in project molgenis by molgenis.
the class EntityTypeRepositorySecurityDecorator method isOperationPermitted.
@Override
public boolean isOperationPermitted(Object id, Action action) {
AbstractPermission permission = getPermissionForOperation(action);
boolean hasPermission = userPermissionEvaluator.hasPermission(new EntityTypeIdentity(id.toString()), permission);
if (hasPermission && !permission.equals(EntityTypePermission.COUNT)) {
boolean isSystem = systemEntityTypeRegistry.hasSystemEntityType(id.toString());
if (isSystem && !currentUserIsSystem()) {
throw new MolgenisDataException(format("No [%s] permission on EntityType [%s]", toMessagePermission(action), id));
}
}
return hasPermission;
}
Aggregations