Any user can remove self from cache
This commit is contained in:
parent
b48a497c30
commit
4e015d5a44
|
@ -143,11 +143,12 @@ public class User extends REST<CKANUser> implements org.gcube.gcat.api.interface
|
|||
public Response removeCallerFromCache() {
|
||||
SecretManager secretManager = SecretManagerProvider.instance.get();
|
||||
org.gcube.common.authorization.utils.user.User user = secretManager.getUser();
|
||||
if(user.getRoles().contains(Role.MANAGER.getPortalRole())) {
|
||||
CKANUserCache.removeUserFromCache();
|
||||
}else {
|
||||
throw new ForbiddenException("Only " + Role.MANAGER.getPortalRole() + "s are authorized to remove an user from the cache");
|
||||
}
|
||||
// if(user.getRoles().contains(Role.MANAGER.getPortalRole())) {
|
||||
// Any user can remove self from cache
|
||||
CKANUserCache.removeUserFromCache();
|
||||
// }else {
|
||||
// throw new ForbiddenException("Only " + Role.MANAGER.getPortalRole() + "s are authorized to remove an user from the cache");
|
||||
// }
|
||||
return Response.status(Status.NO_CONTENT).build();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue