updated set ACLs
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@112128 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
1248407e63
commit
338f9ac8a0
|
@ -764,17 +764,9 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
|
|
||||||
//DEBUG
|
//DEBUG
|
||||||
private void printContacts(List<InfoContactModel> listContacts){
|
private void printContacts(List<InfoContactModel> listContacts){
|
||||||
|
|
||||||
boolean testMode = isTestMode();
|
workspaceLogger.trace("Contacts:");
|
||||||
if(testMode)
|
|
||||||
System.out.println("Contacts: ");
|
|
||||||
else
|
|
||||||
workspaceLogger.trace("Contacts:");
|
|
||||||
|
|
||||||
for (InfoContactModel infoContactModel : listContacts) {
|
for (InfoContactModel infoContactModel : listContacts) {
|
||||||
if(testMode)
|
|
||||||
System.out.println("User: "+infoContactModel);
|
|
||||||
else
|
|
||||||
workspaceLogger.trace("User: "+infoContactModel);
|
workspaceLogger.trace("User: "+infoContactModel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1986,19 +1978,11 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
+ " listContacts size: " + listContacts.size()
|
+ " listContacts size: " + listContacts.size()
|
||||||
+" ACL: "+acl);
|
+" ACL: "+acl);
|
||||||
|
|
||||||
// //DEBUG
|
//DEBUG
|
||||||
//System.out.println("shareFolder "+ folder.getIdentifier() + " name: "+ folder.getName() + " parent name: " + folder.getParentFileModel().getName() + " listContacts size: " + listContacts.size());
|
|
||||||
|
|
||||||
// for (InfoContactModel infoContactModel : listContacts) {
|
|
||||||
// System.out.println("share with "+ infoContactModel.getLogin());
|
|
||||||
// }
|
|
||||||
|
|
||||||
printContacts(listContacts);
|
printContacts(listContacts);
|
||||||
|
|
||||||
List<String> listLogin = UserUtil.getListLoginByInfoContactModel(listContacts);
|
List<String> listLogin = UserUtil.getListLoginByInfoContactModel(listContacts);
|
||||||
|
|
||||||
WorkspaceSharedFolder sharedFolder = null;
|
WorkspaceSharedFolder sharedFolder = null;
|
||||||
|
|
||||||
List<InfoContactModel> listSharedContact = null;
|
List<InfoContactModel> listSharedContact = null;
|
||||||
|
|
||||||
boolean sourceFolderIsShared = folder.isShared();
|
boolean sourceFolderIsShared = folder.isShared();
|
||||||
|
@ -2036,10 +2020,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
if(!sourceFolderIsShared) //if source folder is not already shared
|
if(!sourceFolderIsShared) //if source folder is not already shared
|
||||||
np.notifyFolderSharing(listContacts, sharedFolder);
|
np.notifyFolderSharing(listContacts, sharedFolder);
|
||||||
else{
|
else{
|
||||||
/*System.out.println("SHARED CONTACS: ");
|
// printContacts(listContacts);
|
||||||
printContacts(listSharedContact);
|
|
||||||
System.out.println("NEW CONTACS: ");
|
|
||||||
printContacts(listContacts);*/
|
|
||||||
np.notifyAddedUsersToSharing(listSharedContact, listContacts, sharedFolder);
|
np.notifyAddedUsersToSharing(listSharedContact, listContacts, sharedFolder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2703,21 +2684,26 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
Workspace workspace = getWorkspace();
|
Workspace workspace = getWorkspace();
|
||||||
WorkspaceItem wsItem = workspace.getItem(folderId);
|
WorkspaceItem wsItem = workspace.getItem(folderId);
|
||||||
|
|
||||||
|
//IS A WORKSPACE FOLDER?
|
||||||
if(wsItem!= null && wsItem.isFolder() && wsItem.isShared()){
|
if(wsItem!= null && wsItem.isFolder() && wsItem.isShared()){
|
||||||
WorkspaceSharedFolder ite;
|
WorkspaceFolder ite;
|
||||||
if(wsItem.getType().equals(WorkspaceItemType.SHARED_FOLDER)){
|
if(wsItem.getType().equals(WorkspaceItemType.SHARED_FOLDER)){
|
||||||
//IS ROOT SHARED FOLDER
|
//IS ROOT SHARED FOLDER
|
||||||
ite = (WorkspaceSharedFolder) workspace.getItemByPath(wsItem.getPath());
|
ite = (WorkspaceSharedFolder) wsItem;
|
||||||
|
workspaceLogger.trace("Folder " +ite.getName()+" is a "+WorkspaceSharedFolder.class.getName());
|
||||||
|
// ite = (WorkspaceSharedFolder) workspace.getItemByPath(wsItem.getPath());
|
||||||
}else{
|
}else{
|
||||||
// IS SUB FOLDER OF THE SHARING
|
// IS SUB FOLDER OF THE SHARING
|
||||||
ite = (WorkspaceSharedFolder) workspace.getItem(wsItem.getIdSharedFolder());
|
ite = (WorkspaceFolder) wsItem;
|
||||||
|
workspaceLogger.trace("Folder " +ite.getName()+" is a "+WorkspaceFolder.class.getName());
|
||||||
|
// ite = (WorkspaceSharedFolder) workspace.getItem(wsItem.getIdSharedFolder());
|
||||||
}
|
}
|
||||||
|
|
||||||
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");
|
||||||
|
|
||||||
workspaceLogger.trace("Setting ACL completed, retuning");
|
workspaceLogger.info("Setting ACL for "+wsItem.getName()+" completed, returning");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
workspaceLogger.error("Error in set ACLs", e);
|
workspaceLogger.error("Error in set ACLs", e);
|
||||||
String error = ConstantsExplorer.SERVER_ERROR +" setting permissions. "+e.getMessage();
|
String error = ConstantsExplorer.SERVER_ERROR +" setting permissions. "+e.getMessage();
|
||||||
|
|
Loading…
Reference in New Issue