Added grant to users that have a public folder generated by another user

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@135291 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2016-12-05 13:34:53 +00:00
parent 311d02cf0d
commit 163bb37c45
1 changed files with 4 additions and 0 deletions

View File

@ -3611,6 +3611,10 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
WorkspaceFolder folder = (WorkspaceFolder) item;
InfoContactModel owner = getOwnerByItemId(itemId);
PortalContextInfo context = WsUtil.getPortalContext(this.getThreadLocalRequest());
if(folder.isPublic()){
workspaceLogger.info("The folder is already public. Access granted to "+context.getUsername());
return new AllowAccess(itemId, true, "The folder is already public. Access granted to "+context.getUsername(),null);
}
workspaceLogger.info("owner of: "+folder.getName() +" is: "+owner);
workspaceLogger.info("current context user: "+context.getUsername());
if(owner.getLogin().compareToIgnoreCase(context.getUsername())==0){