[Task #17524] Hiding 'Add Administrator" on VRE Folders

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@181718 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2019-09-18 08:41:37 +00:00
parent d1cf00e69e
commit 5699ae6115
3 changed files with 24 additions and 13 deletions

View File

@ -5,10 +5,16 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="workspace-uploader-2.0.3-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/workspace-uploader-TRUNK/workspace-uploader-TRUNK">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="storagehub-client-wrapper-0.6.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/storagehub-client-wrapper-TRUNK/storagehub-client-wrapper-TRUNK">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="workspace-tree-widget-6.27.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/WorkspaceTree-TRUNK/WorkspaceTree-TRUNK"> <dependent-module archiveName="workspace-tree-widget-6.27.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/WorkspaceTree-TRUNK/WorkspaceTree-TRUNK">
<dependency-type>uses</dependency-type> <dependency-type>uses</dependency-type>
</dependent-module> </dependent-module>
<dependent-module archiveName="ws-task-executor-widget-0.2.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ws-task-executor-widget-TRUNK/ws-task-executor-widget-TRUNK"> <dependent-module archiveName="ws-thredds-sync-widget-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ws-thredds-sync-widget-TRUNK/ws-thredds-sync-widget-TRUNK">
<dependency-type>uses</dependency-type> <dependency-type>uses</dependency-type>
</dependent-module> </dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/> <property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>

View File

@ -3,6 +3,7 @@
component="org.gcube.portlets-user.workspace-portlet.6-23-0" component="org.gcube.portlets-user.workspace-portlet.6-23-0"
date="${buildDate}"> date="${buildDate}">
<Change>[Task #17226] Removing HL </Change> <Change>[Task #17226] Removing HL </Change>
<Change>[Task #17524] Hiding 'Add Administrator" on VRE Folders</Change>
</Changeset> </Changeset>
<Changeset <Changeset
component="org.gcube.portlets-user.workspace-portlet.6-22-0" component="org.gcube.portlets-user.workspace-portlet.6-22-0"

View File

@ -1047,7 +1047,7 @@ public class AppController implements SubscriberInterface {
wsPortlet.getBorderLayoutContainer().updateDnDParentId(parent.getIdentifier()); wsPortlet.getBorderLayoutContainer().updateDnDParentId(parent.getIdentifier());
if(parent.isDirectory() && parent.isShared()){ //IS SHARED FOLDER, ENABLING OPERATION FOR ACTIVE BREADCRUMB if(parent.isDirectory() && parent.isShared()){ //IS SHARED FOLDER, ENABLING OPERATION FOR ACTIVE BREADCRUMB
setACLInfo(parent.getIdentifier()); setACLInfo(parent);
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().enableButtonForActiveBreadcrumb(parent); wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().enableButtonForActiveBreadcrumb(parent);
}else if(parent.isSpecialFolder()){ //IS SPECIAL FOLDER? DISABLING BUTTONS }else if(parent.isSpecialFolder()){ //IS SPECIAL FOLDER? DISABLING BUTTONS
GWT.log("Update Breadcrumb is special folder.. disabling special folder buttons"); GWT.log("Update Breadcrumb is special folder.. disabling special folder buttons");
@ -1070,28 +1070,32 @@ public class AppController implements SubscriberInterface {
* *
* @param parentId the new ACL info * @param parentId the new ACL info
*/ */
private void setACLInfo(final String parentId){ private void setACLInfo(final FileModel toParentACL){
if(parentId==null){ if(toParentACL==null){
wsPortlet.getToolBarItemDetails().updateACLInfo(null); wsPortlet.getToolBarItemDetails().updateACLInfo(null);
return; return;
} }
GWT.log("Updating ACL info for folder id: "+parentId); GWT.log("Updating ACL info for folder id: "+toParentACL.getIdentifier());
WorkspaceSharingServiceAsync.INSTANCE.getUserACLForFolderId(parentId, new AsyncCallback<List<ExtendedWorkspaceACL>>() { WorkspaceSharingServiceAsync.INSTANCE.getUserACLForFolderId(toParentACL.getIdentifier(), new AsyncCallback<List<ExtendedWorkspaceACL>>() {
@Override @Override
public void onFailure(Throwable arg0) { public void onFailure(Throwable arg0) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
GWT.log("Failed: "+arg0);
} }
@Override @Override
public void onSuccess(List<ExtendedWorkspaceACL> res) { public void onSuccess(List<ExtendedWorkspaceACL> res) {
FileModel parent = wsPortlet.getToolBarPath().getLastParent(); FileModel parent = wsPortlet.getToolBarPath().getLastParent();
ConstantsExplorer.log("Validating correct ACL id: "+parentId +" and "+parent.getIdentifier()); GWT.log("Validating correct ACL id: "+toParentACL.getIdentifier() +" and "+parent.getIdentifier());
if(parentId.compareTo(parent.getIdentifier())==0){ if(toParentACL.getIdentifier().compareTo(parent.getIdentifier())==0){
if(res!=null && res.size()>0){ if(res!=null && res.size()>0){
wsPortlet.getToolBarItemDetails().updateACLInfo(res.get(0)); wsPortlet.getToolBarItemDetails().updateACLInfo(res.get(0));
//see Task #17524
if(!parent.isVreFolder())
wsPortlet.getToolBarItemDetails().updateAddAdministatorInfo(AppControllerExplorer.myLogin, res.get(0)); wsPortlet.getToolBarItemDetails().updateAddAdministatorInfo(AppControllerExplorer.myLogin, res.get(0));
} }
} }
@ -1897,16 +1901,16 @@ public class AppController implements SubscriberInterface {
* @see org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface#updatedVREPermissions(java.lang.String) * @see org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface#updatedVREPermissions(java.lang.String)
*/ */
@Override @Override
public void updatedVREPermissions(String vreFolderId) { public void updatedVREPermissions(FileModel vreFolder) {
GxtBreadcrumbPathPanel breadCrumb = this.wsPortlet.getToolBarPath(); GxtBreadcrumbPathPanel breadCrumb = this.wsPortlet.getToolBarPath();
FileModel parent = breadCrumb.getLastParent(); FileModel parent = breadCrumb.getLastParent();
if(parent!=null) if(parent!=null)
GWT.log("UpdatedVREPermissions comparing "+vreFolderId +" and "+parent.getIdentifier()); GWT.log("UpdatedVREPermissions comparing "+vreFolder.getIdentifier() +" and "+parent.getIdentifier());
//IF VRE FOLDER (UPDATED) IS CURRENT BREADCRUMB DISPLAING -> UPDATE //IF VRE FOLDER (UPDATED) IS CURRENT BREADCRUMB DISPLAING -> UPDATE
if(vreFolderId!=null && parent!=null && vreFolderId.compareToIgnoreCase(parent.getIdentifier())==0){ if(vreFolder.getIdentifier()!=null && parent!=null && vreFolder.getIdentifier().compareToIgnoreCase(parent.getIdentifier())==0){
setACLInfo(vreFolderId); setACLInfo(vreFolder);
} }
} }