Fixed required role to create/update Profile

This commit is contained in:
Luca Frosini 2022-04-07 11:41:58 +02:00
parent bcd6ee9bbe
commit e2763d6804
2 changed files with 1 additions and 2 deletions

View File

@ -1,6 +1,5 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
encoding//src/main/java=UTF-8 encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8 encoding//src/test/java=UTF-8
encoding//src/test/resources=UTF-8 encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8 encoding/<project>=UTF-8

View File

@ -172,7 +172,7 @@ public class ISProfile {
public boolean createOrUpdate(String name, String xml) throws SAXException { public boolean createOrUpdate(String name, String xml) throws SAXException {
try { try {
CKANUser ckanUser = CKANUserCache.getCurrrentCKANUser(); CKANUser ckanUser = CKANUserCache.getCurrrentCKANUser();
if(ckanUser.getRole().ordinal()<Role.ADMIN.ordinal()) { if(ckanUser.getRole().ordinal()<Role.EDITOR.ordinal()) {
throw new NotAuthorizedException("You are not authorized to manage profiles, only Catalogue Editor can manipulate profiles."); throw new NotAuthorizedException("You are not authorized to manage profiles, only Catalogue Editor can manipulate profiles.");
} }
MetadataUtility metadataUtility = new MetadataUtility(); MetadataUtility metadataUtility = new MetadataUtility();