38 lines
1005 B
Java
38 lines
1005 B
Java
package eu.dnetlib.uoaauthorizationlibrary.security;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
@Component(value = "AuthorizationService")
|
|
public class AuthorizationService {
|
|
|
|
public final String SUPER_ADMIN = "SUPER_ADMINISTRATOR";
|
|
public final String PORTAL_ADMIN = "PORTAL_ADMINISTRATOR";
|
|
public final String USER_ADMIN = "USER_MANAGER";
|
|
|
|
/**
|
|
* 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 member(String type, String id) {
|
|
return type.toUpperCase() + "_" + id.toUpperCase();
|
|
}
|
|
}
|