diff --git a/CHANGELOG.md b/CHANGELOG.md
index d736f2d..0b74765 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [v1.3.0-SNAPSHOT] - 2021-03-03
+
+[#20847] Support the roles of THREDDS Admin and THREDDS Publisher
+
## [v1.2.0] - 2020-07-21
[#19676] Migrated to git/jenkins
diff --git a/pom.xml b/pom.xml
index eeac454..9556869 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,7 @@
org.gcube.portlets.widgets
ws-thredds-sync-widget
jar
- 1.2.0
+ 1.3.0-SNAPSHOT
ws-thredds-sync-widget
gCube ws-thredds-sync-widget is a widget to use and interact with ws-thredds facility in order to syncronize the Workspace folders with Thredds Reporitory folders
diff --git a/src/main/java/org/gcube/portlets/widgets/wsthreddssync/client/WsThreddsWidget.java b/src/main/java/org/gcube/portlets/widgets/wsthreddssync/client/WsThreddsWidget.java
index 3ce54c1..177da75 100644
--- a/src/main/java/org/gcube/portlets/widgets/wsthreddssync/client/WsThreddsWidget.java
+++ b/src/main/java/org/gcube/portlets/widgets/wsthreddssync/client/WsThreddsWidget.java
@@ -2,6 +2,7 @@ package org.gcube.portlets.widgets.wsthreddssync.client;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import org.gcube.portal.wssynclibrary.shared.WorkspaceFolderLocked;
import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncStatus;
@@ -19,17 +20,21 @@ import org.gcube.portlets.widgets.wsthreddssync.client.rpc.ThreddsWorkspaceSyncS
import org.gcube.portlets.widgets.wsthreddssync.client.view.LoaderIcon;
import org.gcube.portlets.widgets.wsthreddssync.client.view.WsThreddsWidgetViewManager;
import org.gcube.portlets.widgets.wsthreddssync.client.view.binder.MonitorFolderSyncStatusView;
+import org.gcube.portlets.widgets.wsthreddssync.shared.GatewayRolesThredds;
import org.gcube.portlets.widgets.wsthreddssync.shared.WsFolder;
import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderConfiguration;
import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderDescriptor;
+import com.github.gwtbootstrap.client.ui.Alert;
import com.github.gwtbootstrap.client.ui.Modal;
+import com.github.gwtbootstrap.client.ui.constants.AlertType;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.ui.HorizontalPanel;
// TODO: Auto-generated Javadoc
@@ -50,7 +55,13 @@ public class WsThreddsWidget implements HasWsSyncNotificationListner {
private WsThreddsWidgetViewManager viewManager = new WsThreddsWidgetViewManager();
private final List syncEventsListeners = new ArrayList();
-
+
+ public static final String MISSING_THREDDS_ADMIN_RIGHTS = "It seems you are not authorized to create a configuration towards THREDDS Catalogue. Request it to the VRE manager or the portal administrator.";
+
+ public static final String MISSING_THREDDS_PUBLISHER_RIGHTS = "It seems you are not authorized to run a syncronization task towards THREDDS Catalogue. Request it to the VRE manager or the portal administrator.";
+
+ public static final String MISSING_THREDDS_RIGHTS = "It seems you are not authorized to interact with the facility 'Sync with THREDDS'. Request authorization to the VRE manager or the portal administrator.";
+
/**
* This is the entry point method.
*/
@@ -142,38 +153,96 @@ public class WsThreddsWidget implements HasWsSyncNotificationListner {
final Modal box = new Modal(true);
box.setTitle("Checking configurations...");
- LoaderIcon loader = new LoaderIcon("Checking folder configurations...");
- box.add(loader);
-
- GWT.log("Performing isItemSynched: "+folder.getFolderId());
- WsThreddsWidget.wsThreddsSyncService.isItemSynched(folder.getFolderId(), new AsyncCallback() {
+ final HorizontalPanel hpLoader = new HorizontalPanel();
+ LoaderIcon loader = new LoaderIcon("Checking authorizations and folder configurations...");
+ hpLoader.add(loader);
+ box.add(hpLoader);
+
+ //LAOADING ROLES
+ WsThreddsWidget.wsThreddsSyncService.getScopesWithThreddsRolesForLoggedUser(new AsyncCallback