2020-08-04 18:18:08 +02:00
|
|
|
package eu.dnetlib.openaire.usermanagement.utils;
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
@Component("AuthoritiesService")
|
|
|
|
public class AuthoritiesService {
|
|
|
|
|
|
|
|
public final String SUPER_ADMIN = "SUPER_ADMINISTRATOR";
|
|
|
|
public final String PORTAL_ADMIN = "PORTAL_ADMINISTRATOR";
|
2020-08-07 11:23:49 +02:00
|
|
|
public final String USER_ADMIN = "USER_MANAGER";
|
2020-08-04 18:18:08 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Type = FUNDER | COMMUNITY | INSTITUTION | PROJECT
|
|
|
|
*
|
|
|
|
* */
|
|
|
|
public String curator(String type) {
|
|
|
|
return type.toUpperCase() + "_CURATOR";
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Type = FUNDER | COMMUNITY | INSTITUTION | PROJECT
|
|
|
|
*
|
|
|
|
* Id = EE, EGI, etc
|
|
|
|
* */
|
|
|
|
public String manager(String type, String id) {
|
|
|
|
return type.toUpperCase() + "_" + id.toUpperCase() + "_MANAGER";
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Type = FUNDER | COMMUNITY | INSTITUTION | PROJECT
|
|
|
|
*
|
|
|
|
* Id = EE, EGI, etc
|
|
|
|
* */
|
|
|
|
public String subscriber(String type, String id) {
|
|
|
|
return type.toUpperCase() + "_" + id.toUpperCase();
|
|
|
|
}
|
|
|
|
}
|