Commit a901dbec authored by Matija Obreza's avatar Matija Obreza

FIX: Institute admins can't change blurp

parent f1e92b5c
...@@ -176,7 +176,7 @@ public class ContentServiceImpl implements ContentService { ...@@ -176,7 +176,7 @@ public class ContentServiceImpl implements ContentService {
*/ */
@Override @Override
@Transactional(readOnly = false) @Transactional(readOnly = false)
@PreAuthorize("hasRole('ADMINISTRATOR')") @PreAuthorize("hasRole('ADMINISTRATOR') or hasPermission(#entity, 'ADMINISTRATION')")
@CacheEvict(value = "contentcache", allEntries = true) @CacheEvict(value = "contentcache", allEntries = true)
public Article updateArticle(EntityId entity, String slug, String title, String body, Locale locale) { public Article updateArticle(EntityId entity, String slug, String title, String body, Locale locale) {
// return // return
......
...@@ -122,14 +122,14 @@ public class InstituteServiceImpl implements InstituteService { ...@@ -122,14 +122,14 @@ public class InstituteServiceImpl implements InstituteService {
} }
@Override @Override
@PreAuthorize("hasRole('ADMINISTRATOR') or hasPermission(#faoInstitute, 'WRITE')") @PreAuthorize("hasRole('ADMINISTRATOR') or hasPermission(#faoInstitute, 'ADMINISTRATION')")
@Transactional(readOnly = false) @Transactional(readOnly = false)
public void updateBlurp(FaoInstitute faoInstitute, String blurp, Locale locale) { public void updateBlurp(FaoInstitute faoInstitute, String blurp, Locale locale) {
contentService.updateArticle(faoInstitute, "blurp", null, blurp, locale); contentService.updateArticle(faoInstitute, "blurp", null, blurp, locale);
} }
@Override @Override
@PreAuthorize("hasRole('ADMINISTRATOR') or hasPermission(#faoInstitute, 'WRITE')") @PreAuthorize("hasRole('ADMINISTRATOR') or hasPermission(#faoInstitute, 'ADMINISTRATION')")
@Transactional(readOnly = false) @Transactional(readOnly = false)
public void updateSettings(FaoInstitute faoInstitute, Map<String, String> settings) { public void updateSettings(FaoInstitute faoInstitute, Map<String, String> settings) {
List<FaoInstituteSetting> toSave = new ArrayList<FaoInstituteSetting>(); List<FaoInstituteSetting> toSave = new ArrayList<FaoInstituteSetting>();
......
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