This commit is contained in:
Lucio Lelii 2019-09-19 15:14:21 +00:00
parent 76bd21e063
commit cdb53b2bf6
4 changed files with 12 additions and 9 deletions

View File

@ -145,6 +145,8 @@ public class FolderContainer extends ItemContainer<FolderItem>{
return itemclient.getACL(this.itemId); return itemclient.getACL(this.itemId);
} }
/** /**
* *
* changes {@ACL} of the {FolderItem} represented by this FolderContainer for a user * changes {@ACL} of the {FolderItem} represented by this FolderContainer for a user
@ -153,10 +155,10 @@ public class FolderContainer extends ItemContainer<FolderItem>{
* @throws {@InvalidItemException} * @throws {@InvalidItemException}
* @throws {@UserNotAuthorizedException} if user is not administrator of this folder * @throws {@UserNotAuthorizedException} if user is not administrator of this folder
*/ */
public FolderContainer changeAcls(String user, AccessType accessType) throws StorageHubException { /*public FolderContainer changeAcls(String user, AccessType accessType) throws StorageHubException {
itemclient.changeACL(this.itemId, user, accessType); itemclient.changeACL(this.itemId, user, accessType);
return this; return this;
} }*/
public boolean canWrite() throws Exception { public boolean canWrite() throws Exception {
return itemclient.canWriteInto(this.itemId); return itemclient.canWriteInto(this.itemId);

View File

@ -1006,7 +1006,7 @@ public class DefaultItemManager implements ItemManagerClient {
} }
/*
@Override @Override
public String removeSharedFolderAdmin(String id, String user) throws StorageHubException { public String removeSharedFolderAdmin(String id, String user) throws StorageHubException {
Call<GXWebTargetAdapterRequest, String> call = new Call<GXWebTargetAdapterRequest, String>() { Call<GXWebTargetAdapterRequest, String> call = new Call<GXWebTargetAdapterRequest, String>() {
@ -1040,7 +1040,7 @@ public class DefaultItemManager implements ItemManagerClient {
}catch(Exception e1) { }catch(Exception e1) {
throw new RuntimeException(e1); throw new RuntimeException(e1);
} }
} }*/
@Override @Override

View File

@ -49,8 +49,10 @@ public interface ItemManagerClient {
String changeACL(String id, String user, AccessType accessType) throws StorageHubException; String changeACL(String id, String user, AccessType accessType) throws StorageHubException;
/*
String removeSharedFolderAdmin(String id, String user) throws StorageHubException; String removeSharedFolderAdmin(String id, String user) throws StorageHubException;
*/
@Deprecated @Deprecated
void delete(String id) throws StorageHubException; void delete(String id) throws StorageHubException;

View File

@ -30,8 +30,8 @@ public class Items {
@BeforeClass @BeforeClass
public static void setUp(){ public static void setUp(){
SecurityTokenProvider.instance.set("257800d8-24bf-4bae-83cd-ea99369e7dd6-843339462"); SecurityTokenProvider.instance.set("b7c80297-e4ed-42ab-ab42-fdc0b8b0eabf-98187548");
ScopeProvider.instance.set("/d4science.research-infrastructures.eu"); ScopeProvider.instance.set("/gcube");
} }
@ -59,8 +59,7 @@ public class Items {
StorageHubClient shc = new StorageHubClient(); StorageHubClient shc = new StorageHubClient();
shc.open("2ca7e04a-b461-4098-a8b9-a31ddb691a2d").asFolder().changeAcls("giancarlo.panichi", AccessType.READ_ONLY); System.out.println(shc.open("65e502ff-92ef-46cc-afbd-3e91f4b680be").asFolder().canWrite());
} }