Revision 61329
Added by Konstantinos Spyrou almost 3 years ago
AaiUserRoleServiceImpl.java | ||
---|---|---|
30 | 30 |
} |
31 | 31 |
|
32 | 32 |
@Override |
33 |
public String getRoleIdByRepoId(String repoId, String prefix) {
|
|
33 |
public String getRoleIdByRepoId(String repoId) { |
|
34 | 34 |
String roleId = ""; |
35 |
if (repoId != null && prefix != null) { |
|
35 |
String prefix = production ? null : "beta." + "datasource"; |
|
36 |
if (repoId != null) { |
|
36 | 37 |
roleId = createRepoRoleName(prefix, repoId); |
37 | 38 |
return roleId; |
38 | 39 |
} else { |
... | ... | |
62 | 63 |
@Override |
63 | 64 |
public SimpleGrantedAuthority convertRepoIdToAuthority(String repoId) { |
64 | 65 |
String role = convertRepoIdToEncodedAuthorityId(repoId); |
65 |
if (role != null) { |
|
66 |
role = URLEncoder.encode(role); |
|
67 |
} |
|
68 | 66 |
return new SimpleGrantedAuthority(role); |
69 | 67 |
} |
70 | 68 |
|
Also available in: Unified diff
1. update user authorities when adding/removing repositories
2. fixed some authorization expressions
3. refactoring