28 lines
662 B
Java
28 lines
662 B
Java
package eu.dnetlib.repo.manager.utils;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
@Component("AuthorizationService")
|
|
public class AuthorizationService {
|
|
|
|
public final String ROLE_ADMIN = "ROLE_ADMIN";
|
|
public final String ROLE_PROVIDE_ADMIN = "ROLE_PROVIDE_ADMIN";
|
|
public final String ROLE_USER = "ROLE_USER";
|
|
|
|
private String mapType(String type) {
|
|
if(type.equals("datasource")) {
|
|
type = "datasource";
|
|
}
|
|
return type;
|
|
}
|
|
|
|
/**
|
|
* Type = DATASOURCE
|
|
*
|
|
* */
|
|
public String member(String type, String id) {
|
|
return mapType(type).toUpperCase() + "_" + id.toUpperCase();
|
|
}
|
|
|
|
}
|