1 |
59336
|
k.triantaf
|
package eu.dnetlib.uoaauthorizationlibrary.security;
|
2 |
|
|
|
3 |
|
|
import org.springframework.stereotype.Component;
|
4 |
|
|
|
5 |
|
|
@Component(value = "AuthorizationService")
|
6 |
|
|
public class AuthorizationService {
|
7 |
|
|
|
8 |
|
|
public final String SUPER_ADMIN = "SUPER_ADMINISTRATOR";
|
9 |
|
|
public final String PORTAL_ADMIN = "PORTAL_ADMINISTRATOR";
|
10 |
|
|
public final String USER_ADMIN = "USER_MANAGER";
|
11 |
|
|
|
12 |
|
|
/**
|
13 |
|
|
* Type = FUNDER | COMMUNITY | INSTITUTION | PROJECT
|
14 |
|
|
*
|
15 |
|
|
* */
|
16 |
|
|
public String curator(String type) {
|
17 |
|
|
return type.toUpperCase() + "_CURATOR";
|
18 |
|
|
}
|
19 |
|
|
|
20 |
|
|
/**
|
21 |
|
|
* Type = FUNDER | COMMUNITY | INSTITUTION | PROJECT
|
22 |
|
|
*
|
23 |
|
|
* Id = EE, EGI, etc
|
24 |
|
|
* */
|
25 |
|
|
public String manager(String type, String id) {
|
26 |
|
|
return type.toUpperCase() + "_" + id.toUpperCase() + "_MANAGER";
|
27 |
|
|
}
|
28 |
|
|
|
29 |
|
|
/**
|
30 |
|
|
* Type = FUNDER | COMMUNITY | INSTITUTION | PROJECT
|
31 |
|
|
*
|
32 |
|
|
* Id = EE, EGI, etc
|
33 |
|
|
* */
|
34 |
59346
|
k.triantaf
|
public String member(String type, String id) {
|
35 |
59336
|
k.triantaf
|
return type.toUpperCase() + "_" + id.toUpperCase();
|
36 |
|
|
}
|
37 |
|
|
}
|