2017-01-24 17:24:22 +01:00
|
|
|
package org.gcube.datacatalogue.ckanutillibrary.shared;
|
2016-06-14 17:05:24 +02:00
|
|
|
|
|
|
|
/**
|
2016-09-28 11:40:12 +02:00
|
|
|
* Roles that user can have into organizations/groups.
|
2016-06-14 17:05:24 +02:00
|
|
|
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
|
|
|
*/
|
2016-09-28 11:40:12 +02:00
|
|
|
public enum RolesCkanGroupOrOrg{
|
2016-06-14 17:05:24 +02:00
|
|
|
MEMBER,
|
|
|
|
EDITOR,
|
2016-11-17 14:03:33 +01:00
|
|
|
ADMIN;
|
|
|
|
|
|
|
|
public static String convertToCkanCapacity(RolesCkanGroupOrOrg role){
|
|
|
|
|
|
|
|
if(role == null)
|
|
|
|
return null;
|
|
|
|
else
|
|
|
|
return role.toString().toLowerCase();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public static RolesCkanGroupOrOrg convertFromCapacity(String capacity){
|
|
|
|
|
|
|
|
if(capacity == null)
|
|
|
|
return null;
|
|
|
|
else
|
|
|
|
return RolesCkanGroupOrOrg.valueOf(capacity.toUpperCase());
|
|
|
|
|
|
|
|
}
|
2016-06-14 17:05:24 +02:00
|
|
|
}
|