Revision 59763
Added by Konstantinos Triantafyllou over 3 years ago
AuthorizationService.java | ||
---|---|---|
9 | 9 |
public final String PORTAL_ADMIN = "PORTAL_ADMINISTRATOR"; |
10 | 10 |
public final String USER_ADMIN = "USER_MANAGER"; |
11 | 11 |
|
12 |
private String mapType(String type) { |
|
13 |
if(type.equals("organization")) { |
|
14 |
type = "institution"; |
|
15 |
} |
|
16 |
if(type.equals("ri")) { |
|
17 |
type = "community"; |
|
18 |
} |
|
19 |
return type; |
|
20 |
} |
|
21 |
|
|
12 | 22 |
/** |
13 | 23 |
* Type = FUNDER | COMMUNITY | INSTITUTION | PROJECT |
14 | 24 |
* |
15 | 25 |
* */ |
16 | 26 |
public String curator(String type) { |
17 |
return type.toUpperCase() + "_CURATOR";
|
|
27 |
return mapType(type).toUpperCase() + "_CURATOR";
|
|
18 | 28 |
} |
19 | 29 |
|
20 | 30 |
/** |
... | ... | |
23 | 33 |
* Id = EE, EGI, etc |
24 | 34 |
* */ |
25 | 35 |
public String manager(String type, String id) { |
26 |
return type.toUpperCase() + "_" + id.toUpperCase() + "_MANAGER";
|
|
36 |
return mapType(type).toUpperCase() + "_" + id.toUpperCase() + "_MANAGER";
|
|
27 | 37 |
} |
28 | 38 |
|
29 | 39 |
/** |
... | ... | |
32 | 42 |
* Id = EE, EGI, etc |
33 | 43 |
* */ |
34 | 44 |
public String member(String type, String id) { |
35 |
return type.toUpperCase() + "_" + id.toUpperCase();
|
|
45 |
return mapType(type).toUpperCase() + "_" + id.toUpperCase();
|
|
36 | 46 |
} |
37 | 47 |
|
38 | 48 |
public boolean isCommunity(String type) { |
39 |
return type.equals("community");
|
|
49 |
return mapType(type).equals("community");
|
|
40 | 50 |
} |
41 | 51 |
} |
Also available in: Unified diff
[Users | Trunk]: Fix get managers and members calls