Commit ab1badc6 authored by Daniel Gerhardt's avatar Daniel Gerhardt

Fix permission handling for EntityService's `get` method

parent f1ab0c3d
......@@ -24,7 +24,7 @@ public class EntityService<T extends Entity> {
this.objectMapper = objectMapper;
}
@PreAuthorize("hasPermission(type, #id, 'read')")
@PreAuthorize("hasPermission(#id, #this.this.getTypeName(), 'read')")
public T get(final String id) {
return repository.findOne(id);
}
......@@ -67,4 +67,8 @@ public class EntityService<T extends Entity> {
public void delete(final T entity) {
repository.delete(entity);
}
public String getTypeName() {
return type.getSimpleName().toLowerCase();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment