From a901dbec699017897b807a48115e8deaf491f4fb Mon Sep 17 00:00:00 2001 From: Matija Obreza Date: Thu, 20 Feb 2014 18:35:30 +0100 Subject: [PATCH] FIX: Institute admins can't change blurp --- .../org/genesys2/server/service/impl/ContentServiceImpl.java | 2 +- .../genesys2/server/service/impl/InstituteServiceImpl.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/genesys2/server/service/impl/ContentServiceImpl.java b/src/main/java/org/genesys2/server/service/impl/ContentServiceImpl.java index f6d6c1e5e..bf9d69e13 100644 --- a/src/main/java/org/genesys2/server/service/impl/ContentServiceImpl.java +++ b/src/main/java/org/genesys2/server/service/impl/ContentServiceImpl.java @@ -176,7 +176,7 @@ public class ContentServiceImpl implements ContentService { */ @Override @Transactional(readOnly = false) - @PreAuthorize("hasRole('ADMINISTRATOR')") + @PreAuthorize("hasRole('ADMINISTRATOR') or hasPermission(#entity, 'ADMINISTRATION')") @CacheEvict(value = "contentcache", allEntries = true) public Article updateArticle(EntityId entity, String slug, String title, String body, Locale locale) { // return diff --git a/src/main/java/org/genesys2/server/service/impl/InstituteServiceImpl.java b/src/main/java/org/genesys2/server/service/impl/InstituteServiceImpl.java index 561a7ffb5..286080bb0 100644 --- a/src/main/java/org/genesys2/server/service/impl/InstituteServiceImpl.java +++ b/src/main/java/org/genesys2/server/service/impl/InstituteServiceImpl.java @@ -122,14 +122,14 @@ public class InstituteServiceImpl implements InstituteService { } @Override - @PreAuthorize("hasRole('ADMINISTRATOR') or hasPermission(#faoInstitute, 'WRITE')") + @PreAuthorize("hasRole('ADMINISTRATOR') or hasPermission(#faoInstitute, 'ADMINISTRATION')") @Transactional(readOnly = false) public void updateBlurp(FaoInstitute faoInstitute, String blurp, Locale locale) { contentService.updateArticle(faoInstitute, "blurp", null, blurp, locale); } @Override - @PreAuthorize("hasRole('ADMINISTRATOR') or hasPermission(#faoInstitute, 'WRITE')") + @PreAuthorize("hasRole('ADMINISTRATOR') or hasPermission(#faoInstitute, 'ADMINISTRATION')") @Transactional(readOnly = false) public void updateSettings(FaoInstitute faoInstitute, Map settings) { List toSave = new ArrayList(); -- GitLab