|
|
|
@ -27,11 +27,13 @@ import org.apache.jackrabbit.api.security.user.Query;
|
|
|
|
|
import org.apache.jackrabbit.api.security.user.QueryBuilder;
|
|
|
|
|
import org.apache.jackrabbit.api.security.user.User;
|
|
|
|
|
import org.apache.jackrabbit.core.security.principal.PrincipalImpl;
|
|
|
|
|
import org.gcube.common.authorization.control.annotations.AuthorizationControl;
|
|
|
|
|
import org.gcube.common.gxrest.response.outbound.GXOutboundErrorResponse;
|
|
|
|
|
import org.gcube.common.storagehub.model.exceptions.BackendGenericError;
|
|
|
|
|
import org.gcube.common.storagehub.model.types.NodeProperty;
|
|
|
|
|
import org.gcube.data.access.storagehub.Constants;
|
|
|
|
|
import org.gcube.data.access.storagehub.Utils;
|
|
|
|
|
import org.gcube.data.access.storagehub.exception.MyAuthException;
|
|
|
|
|
import org.gcube.data.access.storagehub.handlers.CredentialHandler;
|
|
|
|
|
import org.gcube.data.access.storagehub.handlers.UnshareHandler;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
@ -53,7 +55,7 @@ public class UserManager {
|
|
|
|
|
@GET
|
|
|
|
|
@Path("")
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
//@AuthorizationControl(allowed={"lucio.lelii"}, exception=MyAuthException.class)
|
|
|
|
|
@AuthorizationControl(allowed={"lucio.lelii"}, exception=MyAuthException.class)
|
|
|
|
|
public List<String> getUsers(){
|
|
|
|
|
|
|
|
|
|
JackrabbitSession session = null;
|
|
|
|
@ -87,7 +89,7 @@ public class UserManager {
|
|
|
|
|
@POST
|
|
|
|
|
@Path("")
|
|
|
|
|
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
|
|
|
|
|
//@AuthorizationControl(allowed={"lucio.lelii"}, exception=MyAuthException.class)
|
|
|
|
|
@AuthorizationControl(allowed={"lucio.lelii"}, exception=MyAuthException.class)
|
|
|
|
|
public String createUser(@FormParam("user") String user, @FormParam("password") String password){
|
|
|
|
|
|
|
|
|
|
JackrabbitSession session = null;
|
|
|
|
@ -125,7 +127,7 @@ public class UserManager {
|
|
|
|
|
|
|
|
|
|
@DELETE
|
|
|
|
|
@Path("{id}")
|
|
|
|
|
//@AuthorizationControl(allowed={"lucio.lelii"}, exception=MyAuthException.class)
|
|
|
|
|
@AuthorizationControl(allowed={"lucio.lelii"}, exception=MyAuthException.class)
|
|
|
|
|
public String deleteUser(@PathParam("id") String id){
|
|
|
|
|
|
|
|
|
|
JackrabbitSession session = null;
|
|
|
|
|