git-svn-id: https://svn.d4science-ii.research-infrastructures.eu/gcube/branches/data-access/storagehub-webapp/1.0@179673 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
7dd3ec6efb
commit
a39640271a
|
@ -19,7 +19,7 @@ import org.gcube.common.storagehub.model.types.ItemAction;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@MimeTypeHandler({"image/gif", "image/jpeg","image/png","image/svg+xml"})
|
@MimeTypeHandler({"image/gif", "image/jpeg","image/png" /*, "image/svg+xml"*/})
|
||||||
public class ImageHandler implements ContentHandler{
|
public class ImageHandler implements ContentHandler{
|
||||||
|
|
||||||
private static final int THUMB_MAX_DIM = 300;
|
private static final int THUMB_MAX_DIM = 300;
|
||||||
|
|
|
@ -35,6 +35,7 @@ import org.gcube.common.storagehub.model.exceptions.InvalidCallParameters;
|
||||||
import org.gcube.common.storagehub.model.exceptions.InvalidItemException;
|
import org.gcube.common.storagehub.model.exceptions.InvalidItemException;
|
||||||
import org.gcube.common.storagehub.model.exceptions.StorageHubException;
|
import org.gcube.common.storagehub.model.exceptions.StorageHubException;
|
||||||
import org.gcube.common.storagehub.model.exceptions.UserNotAuthorizedException;
|
import org.gcube.common.storagehub.model.exceptions.UserNotAuthorizedException;
|
||||||
|
import org.gcube.common.storagehub.model.items.FolderItem;
|
||||||
import org.gcube.common.storagehub.model.items.Item;
|
import org.gcube.common.storagehub.model.items.Item;
|
||||||
import org.gcube.common.storagehub.model.items.SharedFolder;
|
import org.gcube.common.storagehub.model.items.SharedFolder;
|
||||||
import org.gcube.common.storagehub.model.types.ACLList;
|
import org.gcube.common.storagehub.model.types.ACLList;
|
||||||
|
@ -198,11 +199,16 @@ public class ACLManager {
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("{id}/acls/user/{user}/canwrite")
|
@Path("{id}/acls/user/{user}/canwrite")
|
||||||
public Boolean checkAccess(@PathParam("user") String user) {
|
public Boolean canWriteInto(@PathParam("user") String user) {
|
||||||
InnerMethodName.instance.set("checkAccess");
|
InnerMethodName.instance.set("canWriteIntoFolder");
|
||||||
Session ses = null;
|
Session ses = null;
|
||||||
Boolean canWrite = false;
|
Boolean canWrite = false;
|
||||||
try{
|
try{
|
||||||
|
Node node = ses.getNodeByIdentifier(id);
|
||||||
|
Item item = node2Item.getItem(node, Excludes.ALL);
|
||||||
|
if (!(item instanceof FolderItem))
|
||||||
|
throw new InvalidItemException("this method can be applied only to folder");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
authChecker.checkWriteAuthorizationControl(ses, id, true);
|
authChecker.checkWriteAuthorizationControl(ses, id, true);
|
||||||
}catch (UserNotAuthorizedException e) {
|
}catch (UserNotAuthorizedException e) {
|
||||||
|
@ -220,7 +226,6 @@ public class ACLManager {
|
||||||
ses.logout();
|
ses.logout();
|
||||||
}
|
}
|
||||||
return canWrite;
|
return canWrite;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue