|
|
|
@ -10,11 +10,14 @@ import javax.ws.rs.Path;
|
|
|
|
|
import javax.ws.rs.PathParam;
|
|
|
|
|
import javax.ws.rs.Produces;
|
|
|
|
|
import javax.ws.rs.core.Response;
|
|
|
|
|
import javax.ws.rs.core.Response.Status;
|
|
|
|
|
|
|
|
|
|
import org.gcube.gcat.annotation.PURGE;
|
|
|
|
|
//import org.gcube.common.authorization.control.annotations.AuthorizationControl;
|
|
|
|
|
import org.gcube.gcat.api.GCatConstants;
|
|
|
|
|
//import org.gcube.gcat.api.roles.Role;
|
|
|
|
|
import org.gcube.gcat.persistence.ckan.CKANUser;
|
|
|
|
|
import org.gcube.gcat.persistence.ckan.CKANUserCache;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author Luca Frosini (ISTI - CNR)
|
|
|
|
@ -66,8 +69,19 @@ public class User extends REST<CKANUser> implements org.gcube.gcat.api.interface
|
|
|
|
|
@DELETE
|
|
|
|
|
@Path("/{" + USER_ID_PARAMETER + "}")
|
|
|
|
|
// @AuthorizationControl(allowedRoles={Role.CATALOGUE_MANAGER}, exception=NotAuthorizedException.class)
|
|
|
|
|
/*
|
|
|
|
|
* Purge user form cache
|
|
|
|
|
*/
|
|
|
|
|
public Response delete(@PathParam(USER_ID_PARAMETER) String username) {
|
|
|
|
|
return super.delete(username, false);
|
|
|
|
|
CKANUserCache.removeUserFromCache();
|
|
|
|
|
return Response.status(Status.NO_CONTENT).build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PURGE
|
|
|
|
|
@Path("/{" + USER_ID_PARAMETER + "}")
|
|
|
|
|
// @AuthorizationControl(allowedRoles={Role.CATALOGUE_MANAGER}, exception=NotAuthorizedException.class)
|
|
|
|
|
public Response purge(@PathParam(USER_ID_PARAMETER) String username) {
|
|
|
|
|
return super.delete(username, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|