fixing the method getAdministrators

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@174502 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2018-12-03 10:05:02 +00:00
parent da556014ae
commit fbeb6a3f93
1 changed files with 12 additions and 6 deletions

View File

@ -2500,16 +2500,21 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
*/
@Override
public List<InfoContactModel> getAdministratorsByFolderId(String folderId) throws Exception {
List<InfoContactModel> admins = new ArrayList<InfoContactModel>();
if(folderId==null)
return admins;
return new ArrayList<InfoContactModel>();
try {
workspaceLogger.info("Getting administator/s to folder: "+folderId);
workspaceLogger.info("Getting administator/s for the folder: "+folderId);
WorkspaceFolder wsFolder = getSharedWorkspaceFolderForId(folderId);
GWTWorkspaceBuilder builder = getGWTWorkspaceBuilder();
WorkspaceSharedFolder wsSharedFolder = (WorkspaceSharedFolder) wsFolder;
return builder.buildGxtInfoContactsFromPortalLogins(wsSharedFolder.getAdministrators());
//Reading the base Shared Folder
Workspace workspace = getWorkspace();
WorkspaceSharedFolder wsBaseSharedFolder = (WorkspaceSharedFolder) workspace.getItem(wsFolder.getIdSharedFolder());
//Reading ADMINS from Root Shared Folder
List<String> admins = wsBaseSharedFolder.getAdministrators();
workspaceLogger.info("Returning admin/s from HL: "+admins.toString());
return GWTWorkspaceBuilder.buildGxtInfoContactsFromPortalLogins(admins);
} catch (WorkspaceHandledException e){
workspaceLogger.error("Error in server getAdministratorsByFolderId: "+e.getMessage());
@ -2569,6 +2574,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
*/
@Override
public WorkspaceACL getACLBySharedFolderId(String identifier) throws Exception {
//THESE ARE WRITE_OWN, WRITE_ALL, READ_ONLY
workspaceLogger.info("Getting ACLBySharedFolderId: "+identifier);
if(identifier==null || identifier.isEmpty()){
workspaceLogger.warn("Getting ACLBySharedFolderId identifier is null or empty, returning null");