1
|
package eu.dnetlib.repo.manager.service.security;
|
2
|
|
3
|
import org.springframework.stereotype.Component;
|
4
|
|
5
|
@Component("AuthorizationService")
|
6
|
public class AuthorizationServiceImpl implements AuthorizationService {
|
7
|
|
8
|
public final String ROLE_ADMIN = "ROLE_ADMIN";
|
9
|
public final String ROLE_PROVIDE_ADMIN = "ROLE_PROVIDE_ADMIN";
|
10
|
public final String ROLE_USER = "ROLE_USER";
|
11
|
|
12
|
private String mapType(String type) {
|
13
|
if (type.equals("datasource")) {
|
14
|
type = "datasource";
|
15
|
}
|
16
|
return type;
|
17
|
}
|
18
|
|
19
|
/**
|
20
|
* Type = DATASOURCE
|
21
|
*/
|
22
|
public String member(String type, String id) {
|
23
|
return mapType(type).toUpperCase() + "_" + id.toUpperCase();
|
24
|
}
|
25
|
|
26
|
}
|