Fix permission check for saveEntityView

This commit is contained in:
Igor Kulikov 2020-08-04 15:10:05 +03:00
parent 974bfd39a5
commit 016191f3d9

View File

@ -116,7 +116,7 @@ public class EntityViewController extends BaseController {
accessControlService accessControlService
.checkPermission(getCurrentUser(), Resource.ENTITY_VIEW, Operation.CREATE, null, entityView); .checkPermission(getCurrentUser(), Resource.ENTITY_VIEW, Operation.CREATE, null, entityView);
} else { } else {
EntityView existingEntityView = checkNotNull(entityViewService.findEntityViewById(getCurrentUser().getTenantId(), entityView.getId())); EntityView existingEntityView = checkEntityViewId(entityView.getId(), Operation.READ);
if (existingEntityView.getKeys() != null) { if (existingEntityView.getKeys() != null) {
if (existingEntityView.getKeys().getAttributes() != null) { if (existingEntityView.getKeys().getAttributes() != null) {
futures.add(deleteAttributesFromEntityView(existingEntityView, DataConstants.CLIENT_SCOPE, existingEntityView.getKeys().getAttributes().getCs(), getCurrentUser())); futures.add(deleteAttributesFromEntityView(existingEntityView, DataConstants.CLIENT_SCOPE, existingEntityView.getKeys().getAttributes().getCs(), getCurrentUser()));