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:
Francesco Mangiacrapa 2015-02-16 14:35:41 +00:00
parent a18896b082
commit e155df4d51
1 changed files with 22 additions and 5 deletions

View File

@ -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{
try {
@ -444,14 +450,25 @@ public class WorkspaceSharingServiceImpl extends RemoteServiceServlet implements
Workspace workspace = getWorkspace();
WorkspaceItem wsItem = workspace.getItem(folderId);
if(wsItem.isShared() && (wsItem.getType().equals(WorkspaceItemType.SHARED_FOLDER))){
WorkspaceSharedFolder ite = (WorkspaceSharedFolder) workspace.getItemByPath(wsItem.getPath());
//IS A WORKSPACE FOLDER?
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));
}else
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) {
logger.info("Error in set ACLs", e);
String error = ConstantsSharing.SERVER_ERROR +" setting permissions. "+e.getMessage();