chagend validateACLToUser to check parent permission
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@113605 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
2733ce7e22
commit
72afddcfb1
|
@ -2998,6 +2998,13 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
Workspace workspace = getWorkspace();
|
Workspace workspace = getWorkspace();
|
||||||
WorkspaceFolder folder = (WorkspaceFolder) workspace.getItem(folderId);
|
WorkspaceFolder folder = (WorkspaceFolder) workspace.getItem(folderId);
|
||||||
|
|
||||||
|
if(!folder.getType().equals(WorkspaceItemType.SHARED_FOLDER)){ //IS NOT ROOT SHARED FOLDER?
|
||||||
|
WorkspaceFolder parent = folder.getParent();
|
||||||
|
if(parent!=null)
|
||||||
|
folder = parent;
|
||||||
|
else
|
||||||
|
workspaceLogger.warn("Parent folder of folder: "+folder.getName() + " is null, using current folder");
|
||||||
|
}
|
||||||
Map<ACLType, List<String>> mapACL = folder.getACLOwner();
|
Map<ACLType, List<String>> mapACL = folder.getACLOwner();
|
||||||
|
|
||||||
ACLType settingACL = ACLType.valueOf(aclType);
|
ACLType settingACL = ACLType.valueOf(aclType);
|
||||||
|
@ -3035,7 +3042,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
//CHANGE ACL IS NOT VALID
|
//CHANGE ACL IS NOT VALID
|
||||||
workspaceLogger.trace("Reject ACL: "+settingACL+ " to "+username);
|
workspaceLogger.trace("Reject ACL: "+settingACL+ " to "+username);
|
||||||
validLogins.remove(username);
|
validLogins.remove(username);
|
||||||
errors.add("Unable to grant the privilege "+settingACL+" for "+fullname+", it's lower than (already assigned) "+ aclHL);
|
errors.add("Unable to grant the privilege "+settingACL+" for "+fullname+", it's lower than (parent privilege) "+ aclHL);
|
||||||
break;
|
break;
|
||||||
}else if(cmp==0){
|
}else if(cmp==0){
|
||||||
//SAME ACL
|
//SAME ACL
|
||||||
|
|
Loading…
Reference in New Issue