1 |
61318
|
spyroukon
|
package eu.dnetlib.repo.manager.service.security;
|
2 |
60749
|
akoulalis
|
|
3 |
|
|
import org.springframework.stereotype.Component;
|
4 |
|
|
|
5 |
|
|
@Component("AuthorizationService")
|
6 |
61318
|
spyroukon
|
public class AuthorizationServiceImpl implements AuthorizationService {
|
7 |
60749
|
akoulalis
|
|
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 |
61318
|
spyroukon
|
if (type.equals("datasource")) {
|
14 |
60749
|
akoulalis
|
type = "datasource";
|
15 |
|
|
}
|
16 |
|
|
return type;
|
17 |
|
|
}
|
18 |
|
|
|
19 |
|
|
/**
|
20 |
|
|
* Type = DATASOURCE
|
21 |
61318
|
spyroukon
|
*/
|
22 |
60749
|
akoulalis
|
public String member(String type, String id) {
|
23 |
|
|
return mapType(type).toUpperCase() + "_" + id.toUpperCase();
|
24 |
|
|
}
|
25 |
|
|
|
26 |
|
|
}
|