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 {
*/
@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
......
......@@ -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<String, String> settings) {
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