Only admin can manage profiles
This commit is contained in:
parent
5c187c9842
commit
f6b97c7b3d
|
@ -161,7 +161,7 @@ public class ISProfile {
|
|||
public boolean createOrUpdate(String name, String xml) throws SAXException {
|
||||
try {
|
||||
CKANUser ckanUser = CKANUserCache.getCurrrentCKANUser();
|
||||
if(ckanUser.getRole().ordinal()<Role.EDITOR.ordinal()) {
|
||||
if(ckanUser.getRole().ordinal()<Role.ADMIN.ordinal()) {
|
||||
throw new NotAuthorizedException("You are not authorized to manage profiles, only Catalogue Editor can manipulate profiles.");
|
||||
}
|
||||
MetadataUtility metadataUtility = new MetadataUtility();
|
||||
|
|
|
@ -46,10 +46,16 @@ public class CKANGroupTest extends ContextTest {
|
|||
String name = "my-test-group";
|
||||
ckanGroup.setName(name);
|
||||
ckanGroup.create();
|
||||
|
||||
|
||||
ckanGroup.delete(true);
|
||||
|
||||
}
|
||||
|
||||
// @Test
|
||||
public void listAllGroups() throws Exception {
|
||||
ContextTest.setContextByName("/d4science.research-infrastructures.eu/D4Research/AGINFRAplusDev");
|
||||
CKANGroup ckanGroup = new CKANGroup();
|
||||
ckanGroup.setApiKey(CKANUtility.getSysAdminAPI());
|
||||
List<String> groups = listGroup();
|
||||
logger.debug("Groups are:\n{}", groups);
|
||||
}
|
||||
|
||||
// @Test
|
||||
|
|
Loading…
Reference in New Issue