updated SetAcls
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-sharing-widget@112127 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
a18896b082
commit
e155df4d51
|
@ -429,7 +429,13 @@ public class WorkspaceSharingServiceImpl extends RemoteServiceServlet implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param folderId
|
||||||
|
* @param listLogins
|
||||||
|
* @param aclType
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
public void setACLs(String folderId, List<String> listLogins, String aclType) throws Exception{
|
public void setACLs(String folderId, List<String> listLogins, String aclType) throws Exception{
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
@ -444,14 +450,25 @@ public class WorkspaceSharingServiceImpl extends RemoteServiceServlet implements
|
||||||
|
|
||||||
Workspace workspace = getWorkspace();
|
Workspace workspace = getWorkspace();
|
||||||
WorkspaceItem wsItem = workspace.getItem(folderId);
|
WorkspaceItem wsItem = workspace.getItem(folderId);
|
||||||
|
|
||||||
if(wsItem.isShared() && (wsItem.getType().equals(WorkspaceItemType.SHARED_FOLDER))){
|
//IS A WORKSPACE FOLDER?
|
||||||
WorkspaceSharedFolder ite = (WorkspaceSharedFolder) workspace.getItemByPath(wsItem.getPath());
|
if(wsItem!= null && wsItem.isFolder() && wsItem.isShared()){
|
||||||
|
WorkspaceFolder ite;
|
||||||
|
if(wsItem.getType().equals(WorkspaceItemType.SHARED_FOLDER)){
|
||||||
|
//IS ROOT SHARED FOLDER
|
||||||
|
ite = (WorkspaceSharedFolder) wsItem;
|
||||||
|
logger.trace("Folder " +ite.getName()+" is a "+WorkspaceSharedFolder.class.getName());
|
||||||
|
}else{
|
||||||
|
// IS SUB FOLDER OF THE SHARING
|
||||||
|
ite = (WorkspaceFolder) wsItem;
|
||||||
|
logger.trace("Folder " +ite.getName()+" is a "+WorkspaceFolder.class.getName());
|
||||||
|
}
|
||||||
|
|
||||||
ite.setACL(listLogins, ACLType.valueOf(aclType));
|
ite.setACL(listLogins, ACLType.valueOf(aclType));
|
||||||
}else
|
}else
|
||||||
throw new Exception("Source item is not shared or shared folder");
|
throw new Exception("Source item is not shared or shared folder");
|
||||||
|
|
||||||
logger.info("Setting ACL completed, retuning");
|
logger.info("Setting ACL for "+wsItem.getName()+" completed, returning");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.info("Error in set ACLs", e);
|
logger.info("Error in set ACLs", e);
|
||||||
String error = ConstantsSharing.SERVER_ERROR +" setting permissions. "+e.getMessage();
|
String error = ConstantsSharing.SERVER_ERROR +" setting permissions. "+e.getMessage();
|
||||||
|
|
Loading…
Reference in New Issue