27 lines
701 B
Java
27 lines
701 B
Java
package eu.dnetlib.repo.manager.service.security;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
@Component("AuthorizationService")
|
|
public class AuthorizationServiceImpl implements 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();
|
|
}
|
|
|
|
}
|