Issue #2236 Merged Mike's Code
Change-Id: I78943ceee3aeea1eeb6d815fefd3e82b46d677a6 Former-commit-id:78766d5567
[formerly2049a9b4da
] [formerlye21cc84d16
] [formerly78766d5567
[formerly2049a9b4da
] [formerlye21cc84d16
] [formerlydb7c81a1df
[formerlye21cc84d16
[formerly 7cc09247bc4166f9586867fba097b4c40577464d]]]] Former-commit-id:db7c81a1df
Former-commit-id:be1b52c989
[formerlyfef2b39123
] [formerly 3c1f19617df625bcf1fc232516da55cda0f42bfc [formerlyfe9e969142
]] Former-commit-id: e29bf91bafd2f989787cde4e5cd1e78eb502884c [formerlya6bff7d97f
] Former-commit-id:aa099029be
This commit is contained in:
parent
4af4e587e8
commit
61dd3901ea
31 changed files with 522 additions and 660 deletions
|
@ -31,7 +31,8 @@ Require-Bundle: org.eclipse.ui,
|
||||||
com.raytheon.uf.common.datadelivery.service;bundle-version="1.0.0",
|
com.raytheon.uf.common.datadelivery.service;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.common.units;bundle-version="1.0.0",
|
com.raytheon.uf.common.units;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.common.site;bundle-version="1.12.1174",
|
com.raytheon.uf.common.site;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.event;bundle-version="1.0.0"
|
com.raytheon.uf.common.event;bundle-version="1.0.0",
|
||||||
|
com.raytheon.uf.common.plugin.nwsauth;bundle-version="1.12.1174"
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Export-Package: com.raytheon.uf.viz.datadelivery;uses:="org.eclipse.ui.plugin,org.osgi.framework",
|
Export-Package: com.raytheon.uf.viz.datadelivery;uses:="org.eclipse.ui.plugin,org.osgi.framework",
|
||||||
|
|
|
@ -25,13 +25,13 @@ import org.eclipse.core.commands.ExecutionException;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.ui.PlatformUI;
|
import org.eclipse.ui.PlatformUI;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.auth.AuthException;
|
||||||
import com.raytheon.uf.common.auth.user.IUser;
|
import com.raytheon.uf.common.auth.user.IUser;
|
||||||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
|
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.viz.core.auth.UserController;
|
import com.raytheon.uf.viz.core.auth.UserController;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
|
||||||
import com.raytheon.uf.viz.datadelivery.browser.DataBrowserDlg;
|
import com.raytheon.uf.viz.datadelivery.browser.DataBrowserDlg;
|
||||||
import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
|
import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@ import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Feb 12, 2012 lvenable Initial creation
|
* Feb 12, 2012 lvenable Initial creation
|
||||||
* Oct 03, 2012 1241 djohnson Use {@link DataDeliveryPermission}.
|
* Oct 03, 2012 1241 djohnson Use {@link DataDeliveryPermission}.
|
||||||
|
* Jul 26, 2013 2236 mpduff Refactored Data Delivery Permissions.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -61,7 +62,8 @@ public class DataBrowserAction extends AbstractHandler {
|
||||||
/** Instance of the dialog */
|
/** Instance of the dialog */
|
||||||
private DataBrowserDlg dlg = null;
|
private DataBrowserDlg dlg = null;
|
||||||
|
|
||||||
private final DataDeliveryPermission permission = DataDeliveryPermission.SUBSCRIPTION_DATASET_BROWSER;
|
private final String permission = DataDeliveryPermission.SUBSCRIPTION_DATASET_BROWSER
|
||||||
|
.toString();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||||
|
@ -73,8 +75,7 @@ public class DataBrowserAction extends AbstractHandler {
|
||||||
+ permission;
|
+ permission;
|
||||||
|
|
||||||
if (DataDeliveryServices.getPermissionsService()
|
if (DataDeliveryServices.getPermissionsService()
|
||||||
.checkPermission(user, msg, permission)
|
.checkPermission(user, msg, permission).isAuthorized()) {
|
||||||
.isAuthorized()) {
|
|
||||||
if ((dlg == null) || (dlg.isDisposed() == true)) {
|
if ((dlg == null) || (dlg.isDisposed() == true)) {
|
||||||
Shell shell = PlatformUI.getWorkbench()
|
Shell shell = PlatformUI.getWorkbench()
|
||||||
.getActiveWorkbenchWindow().getShell();
|
.getActiveWorkbenchWindow().getShell();
|
||||||
|
@ -84,7 +85,7 @@ public class DataBrowserAction extends AbstractHandler {
|
||||||
dlg.bringToTop();
|
dlg.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (AuthException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,13 +25,13 @@ import org.eclipse.core.commands.ExecutionException;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.ui.PlatformUI;
|
import org.eclipse.ui.PlatformUI;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.auth.AuthException;
|
||||||
import com.raytheon.uf.common.auth.user.IUser;
|
import com.raytheon.uf.common.auth.user.IUser;
|
||||||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
|
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.viz.core.auth.UserController;
|
import com.raytheon.uf.viz.core.auth.UserController;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
|
||||||
import com.raytheon.uf.viz.datadelivery.notification.NotificationDlg;
|
import com.raytheon.uf.viz.datadelivery.notification.NotificationDlg;
|
||||||
import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
|
import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jan 30, 2012 mpduff Initial creation
|
* Jan 30, 2012 mpduff Initial creation
|
||||||
* Oct 03, 2012 1241 djohnson Use {@link DataDeliveryPermission}.
|
* Oct 03, 2012 1241 djohnson Use {@link DataDeliveryPermission}.
|
||||||
|
* Jul 26, 2031 2232 mpduff Refactored Data Delivery permissions.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -62,7 +63,8 @@ public class NotificationAction extends AbstractHandler {
|
||||||
private NotificationDlg dlg = null;
|
private NotificationDlg dlg = null;
|
||||||
|
|
||||||
/** Permission string */
|
/** Permission string */
|
||||||
private final DataDeliveryPermission permission = DataDeliveryPermission.NOTIFICATION_VIEW;
|
private final String permission = DataDeliveryPermission.NOTIFICATION_VIEW
|
||||||
|
.toString();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||||
|
@ -84,7 +86,7 @@ public class NotificationAction extends AbstractHandler {
|
||||||
dlg.bringToTop();
|
dlg.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (AuthException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,13 +24,13 @@ import org.eclipse.core.commands.ExecutionEvent;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.ui.PlatformUI;
|
import org.eclipse.ui.PlatformUI;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.auth.AuthException;
|
||||||
import com.raytheon.uf.common.auth.user.IUser;
|
import com.raytheon.uf.common.auth.user.IUser;
|
||||||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
|
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.viz.core.auth.UserController;
|
import com.raytheon.uf.viz.core.auth.UserController;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
|
||||||
import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
|
import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
|
||||||
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionManagerFilter;
|
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionManagerFilter;
|
||||||
import com.raytheon.uf.viz.datadelivery.subscription.SubscriptionManagerDlg;
|
import com.raytheon.uf.viz.datadelivery.subscription.SubscriptionManagerDlg;
|
||||||
|
@ -48,6 +48,7 @@ import com.raytheon.uf.viz.datadelivery.subscription.SubscriptionManagerFilters;
|
||||||
* Jan 10, 2012 mpduff Initial creation
|
* Jan 10, 2012 mpduff Initial creation
|
||||||
* Oct 03, 2012 1241 djohnson Use {@link DataDeliveryPermission}.
|
* Oct 03, 2012 1241 djohnson Use {@link DataDeliveryPermission}.
|
||||||
* May 28, 2013 1650 djohnson Allow using filters for the Subscription Manager Dialog.
|
* May 28, 2013 1650 djohnson Allow using filters for the Subscription Manager Dialog.
|
||||||
|
* Jul 26, 2031 2232 mpduff Refactored Data Delivery permissions.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -65,7 +66,8 @@ public class SubscriptionManagerAction extends AbstractHandler {
|
||||||
private SubscriptionManagerDlg dlg = null;
|
private SubscriptionManagerDlg dlg = null;
|
||||||
|
|
||||||
/** Permission String */
|
/** Permission String */
|
||||||
private final DataDeliveryPermission permission = DataDeliveryPermission.SUBSCRIPTION_VIEW;
|
private final String permission = DataDeliveryPermission.SUBSCRIPTION_VIEW
|
||||||
|
.toString();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
@ -103,7 +105,7 @@ public class SubscriptionManagerAction extends AbstractHandler {
|
||||||
dlg.bringToTop();
|
dlg.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (AuthException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ import org.eclipse.core.commands.ExecutionException;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.ui.PlatformUI;
|
import org.eclipse.ui.PlatformUI;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.auth.AuthException;
|
||||||
import com.raytheon.uf.common.auth.user.IUser;
|
import com.raytheon.uf.common.auth.user.IUser;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.DataSet;
|
import com.raytheon.uf.common.datadelivery.registry.DataSet;
|
||||||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
|
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
|
||||||
|
@ -35,7 +36,6 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.viz.core.auth.UserController;
|
import com.raytheon.uf.viz.core.auth.UserController;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
|
||||||
import com.raytheon.uf.viz.datadelivery.common.ui.LoadSaveConfigDlg;
|
import com.raytheon.uf.viz.datadelivery.common.ui.LoadSaveConfigDlg;
|
||||||
import com.raytheon.uf.viz.datadelivery.common.ui.LoadSaveConfigDlg.DialogType;
|
import com.raytheon.uf.viz.datadelivery.common.ui.LoadSaveConfigDlg.DialogType;
|
||||||
import com.raytheon.uf.viz.datadelivery.filter.MetaDataManager;
|
import com.raytheon.uf.viz.datadelivery.filter.MetaDataManager;
|
||||||
|
@ -58,6 +58,7 @@ import com.raytheon.uf.viz.datadelivery.subscription.subset.xml.SubsetXML;
|
||||||
* Aug 10, 2012 1022 djohnson Store provider name in {@link SubsetXml}, use GriddedDataSet.
|
* Aug 10, 2012 1022 djohnson Store provider name in {@link SubsetXml}, use GriddedDataSet.
|
||||||
* Aug 21, 2012 0743 djohnson Change getMetaData to getDataSet.
|
* Aug 21, 2012 0743 djohnson Change getMetaData to getDataSet.
|
||||||
* Oct 03, 2012 1241 djohnson Use {@link DataDeliveryPermission}.
|
* Oct 03, 2012 1241 djohnson Use {@link DataDeliveryPermission}.
|
||||||
|
* Jul 26, 2031 2232 mpduff Refactored Data Delivery permissions.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -80,7 +81,8 @@ public class SubsetAction extends AbstractHandler {
|
||||||
/** Dialog instance */
|
/** Dialog instance */
|
||||||
private LoadSaveConfigDlg loadDlg = null;
|
private LoadSaveConfigDlg loadDlg = null;
|
||||||
|
|
||||||
private final DataDeliveryPermission permission = DataDeliveryPermission.SUBSCRIPTION_EDIT;
|
private final String permission = DataDeliveryPermission.SUBSCRIPTION_EDIT
|
||||||
|
.toString();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||||
|
@ -120,7 +122,7 @@ public class SubsetAction extends AbstractHandler {
|
||||||
dlg.bringToTop();
|
dlg.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (AuthException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,13 +25,13 @@ import org.eclipse.core.commands.ExecutionException;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.ui.PlatformUI;
|
import org.eclipse.ui.PlatformUI;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.auth.AuthException;
|
||||||
import com.raytheon.uf.common.auth.user.IUser;
|
import com.raytheon.uf.common.auth.user.IUser;
|
||||||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
|
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.viz.core.auth.UserController;
|
import com.raytheon.uf.viz.core.auth.UserController;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
|
||||||
import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
|
import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
|
||||||
import com.raytheon.uf.viz.datadelivery.system.SystemManagementDlg;
|
import com.raytheon.uf.viz.datadelivery.system.SystemManagementDlg;
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ import com.raytheon.uf.viz.datadelivery.system.SystemManagementDlg;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Aug 15, 2012 729 jpiatt Initial creation.
|
* Aug 15, 2012 729 jpiatt Initial creation.
|
||||||
* Oct 03, 2012 1241 djohnson Use {@link DataDeliveryPermission}.
|
* Oct 03, 2012 1241 djohnson Use {@link DataDeliveryPermission}.
|
||||||
|
* Jul 26, 2031 2232 mpduff Refactored Data Delivery permissions.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -64,7 +65,8 @@ public class SystemManagementAction extends AbstractHandler {
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||||
|
|
||||||
final DataDeliveryPermission permission = DataDeliveryPermission.SYSTEM_MANAGEMENT_VIEW;
|
final String permission = DataDeliveryPermission.SYSTEM_MANAGEMENT_VIEW
|
||||||
|
.toString();
|
||||||
IUser user = UserController.getUserObject();
|
IUser user = UserController.getUserObject();
|
||||||
String msg = user.uniqueId()
|
String msg = user.uniqueId()
|
||||||
+ " is not authorized to view Data Delivery System Management\nPermission: "
|
+ " is not authorized to view Data Delivery System Management\nPermission: "
|
||||||
|
@ -84,7 +86,7 @@ public class SystemManagementAction extends AbstractHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (AuthException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,7 @@ import org.eclipse.swt.widgets.MessageBox;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.geotools.geometry.jts.ReferencedEnvelope;
|
import org.geotools.geometry.jts.ReferencedEnvelope;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.auth.AuthException;
|
||||||
import com.raytheon.uf.common.auth.user.IUser;
|
import com.raytheon.uf.common.auth.user.IUser;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.DataSet;
|
import com.raytheon.uf.common.datadelivery.registry.DataSet;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.EnvelopeUtils;
|
import com.raytheon.uf.common.datadelivery.registry.EnvelopeUtils;
|
||||||
|
@ -66,7 +67,6 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.common.util.FileUtil;
|
import com.raytheon.uf.common.util.FileUtil;
|
||||||
import com.raytheon.uf.viz.core.VizApp;
|
import com.raytheon.uf.viz.core.VizApp;
|
||||||
import com.raytheon.uf.viz.core.auth.UserController;
|
import com.raytheon.uf.viz.core.auth.UserController;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
|
||||||
import com.raytheon.uf.viz.datadelivery.common.ui.IDataLoad;
|
import com.raytheon.uf.viz.datadelivery.common.ui.IDataLoad;
|
||||||
import com.raytheon.uf.viz.datadelivery.common.ui.LoadSaveConfigDlg;
|
import com.raytheon.uf.viz.datadelivery.common.ui.LoadSaveConfigDlg;
|
||||||
import com.raytheon.uf.viz.datadelivery.common.ui.LoadSaveConfigDlg.DialogType;
|
import com.raytheon.uf.viz.datadelivery.common.ui.LoadSaveConfigDlg.DialogType;
|
||||||
|
@ -117,6 +117,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* Jun 05, 2013 1800 mpduff Move the area filter below the data type selection.
|
* Jun 05, 2013 1800 mpduff Move the area filter below the data type selection.
|
||||||
* Jun 06, 2013 2030 mpduff Updates to help.
|
* Jun 06, 2013 2030 mpduff Updates to help.
|
||||||
* Jul 05, 2013 2137 mpduff Changed data type to a single select list, changed layout.
|
* Jul 05, 2013 2137 mpduff Changed data type to a single select list, changed layout.
|
||||||
|
* Jul 26, 2031 2232 mpduff Refactored Data Delivery permissions.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -656,7 +657,8 @@ public class DataBrowserDlg extends CaveSWTDialog implements IDataTableUpdate,
|
||||||
* Handle retrieving of subscription subset.
|
* Handle retrieving of subscription subset.
|
||||||
*/
|
*/
|
||||||
private void handleRetrieveSubscribeAction() {
|
private void handleRetrieveSubscribeAction() {
|
||||||
final DataDeliveryPermission permission = DataDeliveryPermission.SUBSCRIPTION_CREATE;
|
final String permission = DataDeliveryPermission.SUBSCRIPTION_CREATE
|
||||||
|
.toString();
|
||||||
IUser user = UserController.getUserObject();
|
IUser user = UserController.getUserObject();
|
||||||
String msg = user.uniqueId()
|
String msg = user.uniqueId()
|
||||||
+ " is not authorized to Create Subscriptions/Queries\nPermission: "
|
+ " is not authorized to Create Subscriptions/Queries\nPermission: "
|
||||||
|
@ -681,7 +683,7 @@ public class DataBrowserDlg extends CaveSWTDialog implements IDataTableUpdate,
|
||||||
shell, data);
|
shell, data);
|
||||||
dlg.open();
|
dlg.open();
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (AuthException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,83 +0,0 @@
|
||||||
/**
|
|
||||||
* This software was developed and / or modified by Raytheon Company,
|
|
||||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
|
||||||
*
|
|
||||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
|
||||||
* This software product contains export-restricted data whose
|
|
||||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
|
||||||
* to non-U.S. persons whether in the United States or abroad requires
|
|
||||||
* an export license or other authorization.
|
|
||||||
*
|
|
||||||
* Contractor Name: Raytheon Company
|
|
||||||
* Contractor Address: 6825 Pine Street, Suite 340
|
|
||||||
* Mail Stop B8
|
|
||||||
* Omaha, NE 68106
|
|
||||||
* 402.291.0100
|
|
||||||
*
|
|
||||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
|
||||||
* further licensing information.
|
|
||||||
**/
|
|
||||||
package com.raytheon.uf.viz.datadelivery.comm;
|
|
||||||
|
|
||||||
import com.raytheon.uf.common.auth.req.AbstractPrivilegedRequest;
|
|
||||||
import com.raytheon.uf.common.auth.resp.UserNotAuthenticated;
|
|
||||||
import com.raytheon.uf.common.auth.resp.UserNotAuthorized;
|
|
||||||
import com.raytheon.uf.common.auth.user.IUser;
|
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
|
||||||
import com.raytheon.uf.viz.core.requests.INotAuthHandler;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO Add Description
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
*
|
|
||||||
* SOFTWARE HISTORY
|
|
||||||
*
|
|
||||||
* Date Ticket# Engineer Description
|
|
||||||
* ------------ ---------- ----------- --------------------------
|
|
||||||
* Apr 13, 2012 mpduff Initial creation
|
|
||||||
*
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @author mpduff
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class DataDeliveryNotAuthHandler implements INotAuthHandler {
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* com.raytheon.uf.viz.core.requests.INotAuthHandler#notAuthenticated(com
|
|
||||||
* .raytheon.uf.common.auth.resp.UserNotAuthenticated)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Object notAuthenticated(UserNotAuthenticated response) throws VizException {
|
|
||||||
AbstractPrivilegedRequest request = response.getRequest();
|
|
||||||
IUser user = request.getUser();
|
|
||||||
String message =
|
|
||||||
"User: <" + user.uniqueId() + "> is not authenticated to perform request:" + request.getClass();
|
|
||||||
UFStatus.getHandler(DataDeliveryNotAuthHandler.class).handle(Priority.PROBLEM, message);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* com.raytheon.uf.viz.core.requests.INotAuthHandler#notAuthorized(com.raytheon
|
|
||||||
* .uf.common.auth.resp.UserNotAuthorized)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Object notAuthorized(UserNotAuthorized response) throws VizException {
|
|
||||||
String message = response.getMessage();
|
|
||||||
if (message == null) {
|
|
||||||
message = "Error sending request for user: " + response.getRequest().getUser().uniqueId().toString();
|
|
||||||
}
|
|
||||||
UFStatus.getHandler(DataDeliveryNotAuthHandler.class).handle(Priority.PROBLEM, message);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -19,11 +19,11 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.viz.datadelivery.services;
|
package com.raytheon.uf.viz.datadelivery.services;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.auth.req.IPermissionsService;
|
||||||
import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthService;
|
import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthService;
|
||||||
import com.raytheon.uf.common.datadelivery.service.IGroupDefinitionService;
|
import com.raytheon.uf.common.datadelivery.service.IGroupDefinitionService;
|
||||||
import com.raytheon.uf.common.datadelivery.service.ISubscriptionNotificationService;
|
import com.raytheon.uf.common.datadelivery.service.ISubscriptionNotificationService;
|
||||||
import com.raytheon.uf.common.datadelivery.service.subscription.ISubscriptionOverlapService;
|
import com.raytheon.uf.common.datadelivery.service.subscription.ISubscriptionOverlapService;
|
||||||
import com.raytheon.uf.viz.datadelivery.subscription.IPermissionsService;
|
|
||||||
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionService;
|
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -39,6 +39,7 @@ import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionService;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Nov 09, 2012 1286 djohnson Initial creation
|
* Nov 09, 2012 1286 djohnson Initial creation
|
||||||
* May 20, 2013 2000 djohnson Add subscription overlap service.
|
* May 20, 2013 2000 djohnson Add subscription overlap service.
|
||||||
|
* Jul 26, 2031 2232 mpduff Moved IPermissionsService to common.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
|
|
@ -43,6 +43,7 @@ import org.eclipse.swt.widgets.Layout;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.swt.widgets.Text;
|
import org.eclipse.swt.widgets.Text;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.auth.AuthException;
|
||||||
import com.raytheon.uf.common.auth.user.IUser;
|
import com.raytheon.uf.common.auth.user.IUser;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.DataType;
|
import com.raytheon.uf.common.datadelivery.registry.DataType;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.PointTime;
|
import com.raytheon.uf.common.datadelivery.registry.PointTime;
|
||||||
|
@ -55,7 +56,6 @@ import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.common.util.StringUtil;
|
import com.raytheon.uf.common.util.StringUtil;
|
||||||
import com.raytheon.uf.viz.core.auth.UserController;
|
import com.raytheon.uf.viz.core.auth.UserController;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
|
||||||
import com.raytheon.uf.viz.datadelivery.common.ui.ActivePeriodComp;
|
import com.raytheon.uf.viz.datadelivery.common.ui.ActivePeriodComp;
|
||||||
import com.raytheon.uf.viz.datadelivery.common.ui.DurationComp;
|
import com.raytheon.uf.viz.datadelivery.common.ui.DurationComp;
|
||||||
import com.raytheon.uf.viz.datadelivery.common.ui.GroupSelectComp;
|
import com.raytheon.uf.viz.datadelivery.common.ui.GroupSelectComp;
|
||||||
|
@ -101,6 +101,7 @@ import com.raytheon.viz.ui.presenter.components.CheckBoxConf;
|
||||||
* May 15, 2013 1040 mpduff Add Shared sites.
|
* May 15, 2013 1040 mpduff Add Shared sites.
|
||||||
* Jun 04, 2013 223 mpduff Modify for point data.
|
* Jun 04, 2013 223 mpduff Modify for point data.
|
||||||
* Jun 12, 2013 2038 djohnson No longer modal.
|
* Jun 12, 2013 2038 djohnson No longer modal.
|
||||||
|
* Jul 26, 2031 2232 mpduff Refactored Data Delivery permissions.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -185,8 +186,8 @@ public class CreateSubscriptionDlg extends CaveSWTDialog implements
|
||||||
* true for new subscription, false for edit
|
* true for new subscription, false for edit
|
||||||
*/
|
*/
|
||||||
public CreateSubscriptionDlg(Shell parent, boolean create) {
|
public CreateSubscriptionDlg(Shell parent, boolean create) {
|
||||||
super(parent, SWT.DIALOG_TRIM,
|
super(parent, SWT.DIALOG_TRIM, CAVE.INDEPENDENT_SHELL
|
||||||
CAVE.INDEPENDENT_SHELL | CAVE.PERSPECTIVE_INDEPENDENT);
|
| CAVE.PERSPECTIVE_INDEPENDENT);
|
||||||
this.create = create;
|
this.create = create;
|
||||||
|
|
||||||
if (create) {
|
if (create) {
|
||||||
|
@ -338,7 +339,8 @@ public class CreateSubscriptionDlg extends CaveSWTDialog implements
|
||||||
btn.setToolTipText("Select sites for sharing");
|
btn.setToolTipText("Select sites for sharing");
|
||||||
btn.setEnabled(false);
|
btn.setEnabled(false);
|
||||||
|
|
||||||
final DataDeliveryPermission permission = DataDeliveryPermission.SHARED_SUBSCRIPTION_CREATE;
|
final String permission = DataDeliveryPermission.SHARED_SUBSCRIPTION_CREATE
|
||||||
|
.toString();
|
||||||
final IUser user = UserController.getUserObject();
|
final IUser user = UserController.getUserObject();
|
||||||
final String msg = user.uniqueId()
|
final String msg = user.uniqueId()
|
||||||
+ " is not authorized to create shared subscriptions. "
|
+ " is not authorized to create shared subscriptions. "
|
||||||
|
@ -366,7 +368,7 @@ public class CreateSubscriptionDlg extends CaveSWTDialog implements
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (VizException e1) {
|
} catch (AuthException e1) {
|
||||||
statusHandler
|
statusHandler
|
||||||
.handle(Priority.PROBLEM, e1.getLocalizedMessage(), e1);
|
.handle(Priority.PROBLEM, e1.getLocalizedMessage(), e1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,13 +21,15 @@ package com.raytheon.uf.viz.datadelivery.subscription;
|
||||||
|
|
||||||
import java.rmi.RemoteException;
|
import java.rmi.RemoteException;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.auth.AuthException;
|
||||||
|
import com.raytheon.uf.common.auth.req.IPermissionsService;
|
||||||
import com.raytheon.uf.common.auth.user.IUser;
|
import com.raytheon.uf.common.auth.user.IUser;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.SharedSubscription;
|
import com.raytheon.uf.common.datadelivery.registry.SharedSubscription;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryAuthRequest;
|
|
||||||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
|
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
|
||||||
import com.raytheon.uf.common.datadelivery.service.BasePrivilegedDataDeliveryService;
|
import com.raytheon.uf.common.datadelivery.service.BasePrivilegedDataDeliveryService;
|
||||||
|
import com.raytheon.uf.common.plugin.nwsauth.NwsAuthRequest;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -45,6 +47,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
* Feb 26, 2013 1643 djohnson Extends base class.
|
* Feb 26, 2013 1643 djohnson Extends base class.
|
||||||
* Mar 29, 2013 1841 djohnson Subscription is now UserSubscription.
|
* Mar 29, 2013 1841 djohnson Subscription is now UserSubscription.
|
||||||
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
* May 21, 2013 2020 mpduff Rename UserSubscription to SiteSubscription.
|
||||||
|
* Jul 26, 2031 2232 mpduff Refactored Data Delivery permissions, removed DataDeliveryAuthRequest.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -53,24 +56,24 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class RequestFromServerPermissionsService extends
|
public class RequestFromServerPermissionsService extends
|
||||||
BasePrivilegedDataDeliveryService<DataDeliveryAuthRequest> implements
|
BasePrivilegedDataDeliveryService<NwsAuthRequest> implements
|
||||||
IPermissionsService {
|
IPermissionsService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adapts the {@link DataDeliveryAuthRequestAdapter} to match the
|
* Adapts the {@link NwsAuthRequestAdapter} to match the
|
||||||
* {@link IAuthorizedPermissionResponse} interface.
|
* {@link IAuthorizedPermissionResponse} interface.
|
||||||
*/
|
*/
|
||||||
private class DataDeliveryAuthRequestAdapter implements
|
private class NwsAuthRequestAdapter implements
|
||||||
IAuthorizedPermissionResponse {
|
IAuthorizedPermissionResponse {
|
||||||
|
|
||||||
private final DataDeliveryAuthRequest response;
|
private final NwsAuthRequest response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The response to adapt.
|
* The response to adapt.
|
||||||
*
|
*
|
||||||
* @param response
|
* @param response
|
||||||
*/
|
*/
|
||||||
private DataDeliveryAuthRequestAdapter(DataDeliveryAuthRequest response) {
|
private NwsAuthRequestAdapter(NwsAuthRequest response) {
|
||||||
this.response = response;
|
this.response = response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,18 +89,22 @@ public class RequestFromServerPermissionsService extends
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean hasPermission(DataDeliveryPermission permission) {
|
public boolean hasPermission(String permission) {
|
||||||
return (isAuthorized()) ? response.isAuthorized(permission) : false;
|
return (isAuthorized()) ? response.isAuthorized(permission) : false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
*
|
||||||
|
* @param user
|
||||||
|
* @param notAuthorizedMessage
|
||||||
|
* @param subscription
|
||||||
|
* @return
|
||||||
|
* @throws VizException
|
||||||
*/
|
*/
|
||||||
@Override
|
|
||||||
public IAuthorizedPermissionResponse checkPermissionToChangeSubscription(
|
public IAuthorizedPermissionResponse checkPermissionToChangeSubscription(
|
||||||
final IUser user, String notAuthorizedMessage,
|
final IUser user, String notAuthorizedMessage,
|
||||||
final Subscription subscription) throws VizException {
|
final Subscription subscription) throws AuthException {
|
||||||
|
|
||||||
// TODO: Can this be done better?
|
// TODO: Can this be done better?
|
||||||
if (subscription instanceof SiteSubscription) {
|
if (subscription instanceof SiteSubscription) {
|
||||||
|
@ -112,20 +119,23 @@ public class RequestFromServerPermissionsService extends
|
||||||
|
|
||||||
private IAuthorizedPermissionResponse checkPermissionToChangeSubscription(
|
private IAuthorizedPermissionResponse checkPermissionToChangeSubscription(
|
||||||
final IUser user, String notAuthorizedMessage,
|
final IUser user, String notAuthorizedMessage,
|
||||||
final SiteSubscription subscription) throws VizException {
|
final SiteSubscription subscription) throws AuthException {
|
||||||
|
|
||||||
|
String approveSitePermission = DataDeliveryPermission.SUBSCRIPTION_APPROVE_SITE
|
||||||
|
.toString();
|
||||||
|
String approveUserPermission = DataDeliveryPermission.SUBSCRIPTION_APPROVE_USER
|
||||||
|
.toString();
|
||||||
final IAuthorizedPermissionResponse r = checkPermissions(user,
|
final IAuthorizedPermissionResponse r = checkPermissions(user,
|
||||||
notAuthorizedMessage,
|
notAuthorizedMessage, approveSitePermission,
|
||||||
DataDeliveryPermission.SUBSCRIPTION_APPROVE_SITE,
|
approveUserPermission);
|
||||||
DataDeliveryPermission.SUBSCRIPTION_APPROVE_USER);
|
|
||||||
|
|
||||||
// If they have site permissions, then yes they can approve the
|
// If they have site permissions, then yes they can approve the
|
||||||
// subscription
|
// subscription
|
||||||
if (r.hasPermission(DataDeliveryPermission.SUBSCRIPTION_APPROVE_SITE)) {
|
if (r.hasPermission(approveSitePermission)) {
|
||||||
return r;
|
return r;
|
||||||
} else {
|
} else {
|
||||||
// Otherwise they must have user approval permission and be the
|
// Otherwise they must have user approval permission and be the
|
||||||
// owner
|
// ownerBaseServerService
|
||||||
return new IAuthorizedPermissionResponse() {
|
return new IAuthorizedPermissionResponse() {
|
||||||
@Override
|
@Override
|
||||||
public boolean isAuthorized() {
|
public boolean isAuthorized() {
|
||||||
|
@ -135,7 +145,7 @@ public class RequestFromServerPermissionsService extends
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasPermission(DataDeliveryPermission permission) {
|
public boolean hasPermission(String permission) {
|
||||||
return r.hasPermission(permission);
|
return r.hasPermission(permission);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -144,12 +154,12 @@ public class RequestFromServerPermissionsService extends
|
||||||
|
|
||||||
private IAuthorizedPermissionResponse checkPermissionToChangeSubscription(
|
private IAuthorizedPermissionResponse checkPermissionToChangeSubscription(
|
||||||
final IUser user, String notAuthorizedMessage,
|
final IUser user, String notAuthorizedMessage,
|
||||||
final SharedSubscription subscription) throws VizException {
|
final SharedSubscription subscription) throws AuthException {
|
||||||
|
|
||||||
// TODO: New permission to approve/change shared subscriptions?
|
// TODO: New permission to approve/change shared subscriptions?
|
||||||
final IAuthorizedPermissionResponse r = checkPermissions(user,
|
final IAuthorizedPermissionResponse r = checkPermissions(user,
|
||||||
notAuthorizedMessage,
|
notAuthorizedMessage,
|
||||||
DataDeliveryPermission.SUBSCRIPTION_APPROVE_SITE);
|
DataDeliveryPermission.SUBSCRIPTION_APPROVE_SITE.toString());
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
@ -159,10 +169,10 @@ public class RequestFromServerPermissionsService extends
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IAuthorizedPermissionResponse checkPermission(IUser user,
|
public IAuthorizedPermissionResponse checkPermission(IUser user,
|
||||||
String notAuthorizedMessage, DataDeliveryPermission permission)
|
String notAuthorizedMessage, String permission)
|
||||||
throws VizException {
|
throws AuthException {
|
||||||
return checkPermissions(user, notAuthorizedMessage,
|
return checkPermissions(user, notAuthorizedMessage,
|
||||||
new DataDeliveryPermission[] { permission });
|
new String[] { permission });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -170,20 +180,19 @@ public class RequestFromServerPermissionsService extends
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IAuthorizedPermissionResponse checkPermissions(IUser user,
|
public IAuthorizedPermissionResponse checkPermissions(IUser user,
|
||||||
String notAuthorizedMessage, DataDeliveryPermission... permissions)
|
String notAuthorizedMessage, String... permissions)
|
||||||
throws VizException {
|
throws AuthException {
|
||||||
|
|
||||||
DataDeliveryAuthRequest request = new DataDeliveryAuthRequest();
|
NwsAuthRequest request = new NwsAuthRequest();
|
||||||
request.setUser(user);
|
request.setUser(user);
|
||||||
request.addRequestedPermissions(permissions);
|
request.addRequestedPermissions(permissions);
|
||||||
request.setNotAuthorizedMessage(notAuthorizedMessage);
|
request.setNotAuthorizedMessage(notAuthorizedMessage);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
DataDeliveryAuthRequest r = sendRequest(request,
|
NwsAuthRequest r = sendRequest(request, NwsAuthRequest.class);
|
||||||
DataDeliveryAuthRequest.class);
|
return new NwsAuthRequestAdapter(r);
|
||||||
return new DataDeliveryAuthRequestAdapter(r);
|
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
throw new VizException(e);
|
throw new AuthException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,7 @@ import org.eclipse.swt.widgets.MenuItem;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.swt.widgets.TableColumn;
|
import org.eclipse.swt.widgets.TableColumn;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.auth.AuthException;
|
||||||
import com.raytheon.uf.common.auth.user.IUser;
|
import com.raytheon.uf.common.auth.user.IUser;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionHandler;
|
import com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionHandler;
|
||||||
|
@ -62,7 +63,6 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.viz.core.auth.UserController;
|
import com.raytheon.uf.viz.core.auth.UserController;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
|
||||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||||
import com.raytheon.uf.viz.datadelivery.actions.DataBrowserAction;
|
import com.raytheon.uf.viz.datadelivery.actions.DataBrowserAction;
|
||||||
import com.raytheon.uf.viz.datadelivery.common.ui.IGroupAction;
|
import com.raytheon.uf.viz.datadelivery.common.ui.IGroupAction;
|
||||||
|
@ -126,6 +126,7 @@ import com.raytheon.viz.ui.presenter.IDisplay;
|
||||||
* Jun 05, 2013 2064 mpduff Fix for filtering combo boxes.
|
* Jun 05, 2013 2064 mpduff Fix for filtering combo boxes.
|
||||||
* Jun 06, 2013 2030 mpduff Refactored help.
|
* Jun 06, 2013 2030 mpduff Refactored help.
|
||||||
* Jun 14, 2013 2064 mpduff Check for null/disposed sort column.
|
* Jun 14, 2013 2064 mpduff Check for null/disposed sort column.
|
||||||
|
* Jul 26, 2031 2232 mpduff Refactored Data Delivery permissions.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author mpduff
|
* @author mpduff
|
||||||
|
@ -598,7 +599,8 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
||||||
*/
|
*/
|
||||||
private void createSubscription() {
|
private void createSubscription() {
|
||||||
// check to see if authorized
|
// check to see if authorized
|
||||||
final DataDeliveryPermission permission = DataDeliveryPermission.SUBSCRIPTION_CREATE;
|
final String permission = DataDeliveryPermission.SUBSCRIPTION_CREATE
|
||||||
|
.toString();
|
||||||
IUser user = UserController.getUserObject();
|
IUser user = UserController.getUserObject();
|
||||||
String msg = user.uniqueId()
|
String msg = user.uniqueId()
|
||||||
+ " is not authorized to create subscriptions";
|
+ " is not authorized to create subscriptions";
|
||||||
|
@ -614,7 +616,7 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
||||||
statusHandler.handle(
|
statusHandler.handle(
|
||||||
com.raytheon.uf.common.status.UFStatus.Priority.ERROR,
|
com.raytheon.uf.common.status.UFStatus.Priority.ERROR,
|
||||||
e.getLocalizedMessage(), e);
|
e.getLocalizedMessage(), e);
|
||||||
} catch (VizException e) {
|
} catch (AuthException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -627,7 +629,8 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
||||||
*/
|
*/
|
||||||
private void handleGroupCreate(boolean create) {
|
private void handleGroupCreate(boolean create) {
|
||||||
|
|
||||||
final DataDeliveryPermission permission = DataDeliveryPermission.SUBSCRIPTION_CREATE;
|
final String permission = DataDeliveryPermission.SUBSCRIPTION_CREATE
|
||||||
|
.toString();
|
||||||
IUser user = UserController.getUserObject();
|
IUser user = UserController.getUserObject();
|
||||||
String msg = user.uniqueId()
|
String msg = user.uniqueId()
|
||||||
+ " is not authorized to access the Dataset Discovery Browser\nPermission: "
|
+ " is not authorized to access the Dataset Discovery Browser\nPermission: "
|
||||||
|
@ -660,7 +663,7 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (AuthException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
"Error occurred in authorization request", e);
|
"Error occurred in authorization request", e);
|
||||||
}
|
}
|
||||||
|
@ -720,7 +723,8 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final DataDeliveryPermission permission = DataDeliveryPermission.SUBSCRIPTION_DELETE;
|
final String permission = DataDeliveryPermission.SUBSCRIPTION_DELETE
|
||||||
|
.toString();
|
||||||
|
|
||||||
IUser user = UserController.getUserObject();
|
IUser user = UserController.getUserObject();
|
||||||
String msg = user.uniqueId()
|
String msg = user.uniqueId()
|
||||||
|
@ -778,7 +782,7 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
||||||
job.schedule();
|
job.schedule();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (AuthException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -833,7 +837,8 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
||||||
getShell().setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
|
getShell().setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
|
||||||
|
|
||||||
// Check for activate premissions
|
// Check for activate premissions
|
||||||
final DataDeliveryPermission permission = DataDeliveryPermission.SUBSCRIPTION_ACTIVATE;
|
final String permission = DataDeliveryPermission.SUBSCRIPTION_ACTIVATE
|
||||||
|
.toString();
|
||||||
|
|
||||||
final IUser user = UserController.getUserObject();
|
final IUser user = UserController.getUserObject();
|
||||||
final String username = user.uniqueId().toString();
|
final String username = user.uniqueId().toString();
|
||||||
|
@ -896,7 +901,7 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (AuthException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1051,7 +1056,7 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If null get the first one
|
// If null get the first one
|
||||||
if (sortedTableColumn == null) {
|
if (sortedTableColumn == null) {
|
||||||
sortedTableColumn = tableComp.getTable().getColumn(0);
|
sortedTableColumn = tableComp.getTable().getColumn(0);
|
||||||
|
@ -1087,12 +1092,16 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
|
||||||
|
|
||||||
return DataDeliveryServices
|
return DataDeliveryServices
|
||||||
.getPermissionsService()
|
.getPermissionsService()
|
||||||
.checkPermissions(user, msg,
|
.checkPermissions(
|
||||||
DataDeliveryPermission.SUBSCRIPTION_APPROVE_SITE,
|
user,
|
||||||
DataDeliveryPermission.SUBSCRIPTION_APPROVE_USER,
|
msg,
|
||||||
DataDeliveryPermission.SUBSCRIPTION_APPROVE_VIEW)
|
DataDeliveryPermission.SUBSCRIPTION_APPROVE_SITE
|
||||||
.isAuthorized();
|
.toString(),
|
||||||
} catch (VizException e) {
|
DataDeliveryPermission.SUBSCRIPTION_APPROVE_USER
|
||||||
|
.toString(),
|
||||||
|
DataDeliveryPermission.SUBSCRIPTION_APPROVE_VIEW
|
||||||
|
.toString()).isAuthorized();
|
||||||
|
} catch (Exception e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,8 @@ import org.eclipse.swt.widgets.Shell;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
import com.raytheon.uf.common.auth.AuthException;
|
||||||
|
import com.raytheon.uf.common.auth.req.IPermissionsService;
|
||||||
import com.raytheon.uf.common.auth.user.IUser;
|
import com.raytheon.uf.common.auth.user.IUser;
|
||||||
import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthService;
|
import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthService;
|
||||||
import com.raytheon.uf.common.datadelivery.bandwidth.IProposeScheduleResponse;
|
import com.raytheon.uf.common.datadelivery.bandwidth.IProposeScheduleResponse;
|
||||||
|
@ -58,7 +60,6 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.common.util.StringUtil;
|
import com.raytheon.uf.common.util.StringUtil;
|
||||||
import com.raytheon.uf.viz.core.VizApp;
|
import com.raytheon.uf.viz.core.VizApp;
|
||||||
import com.raytheon.uf.viz.core.auth.UserController;
|
import com.raytheon.uf.viz.core.auth.UserController;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
|
||||||
import com.raytheon.uf.viz.datadelivery.actions.SubscriptionManagerAction;
|
import com.raytheon.uf.viz.datadelivery.actions.SubscriptionManagerAction;
|
||||||
import com.raytheon.uf.viz.datadelivery.system.SystemRuleManager;
|
import com.raytheon.uf.viz.datadelivery.system.SystemRuleManager;
|
||||||
import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils;
|
import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils;
|
||||||
|
@ -86,6 +87,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils;
|
||||||
* May 23, 2013 1650 djohnson Move out some presentation logic to DisplayForceApplyPromptDialog.
|
* May 23, 2013 1650 djohnson Move out some presentation logic to DisplayForceApplyPromptDialog.
|
||||||
* Jun 12, 2013 2038 djohnson Launch subscription manager on the UI thread.
|
* Jun 12, 2013 2038 djohnson Launch subscription manager on the UI thread.
|
||||||
* Jul 18, 2013 1653 mpduff Add SubscriptionStatusSummary.
|
* Jul 18, 2013 1653 mpduff Add SubscriptionStatusSummary.
|
||||||
|
* Jul 26, 2031 2232 mpduff Refactored Data Delivery permissions.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -488,7 +490,13 @@ public class SubscriptionService implements ISubscriptionService {
|
||||||
final String username = user.uniqueId().toString();
|
final String username = user.uniqueId().toString();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
boolean authorized = permissionsService
|
if (!(permissionsService instanceof RequestFromServerPermissionsService)) {
|
||||||
|
throw new RegistryHandlerException(
|
||||||
|
"Invalid Handler "
|
||||||
|
+ permissionsService.getClass()
|
||||||
|
.toString());
|
||||||
|
}
|
||||||
|
boolean authorized = ((RequestFromServerPermissionsService) permissionsService)
|
||||||
.checkPermissionToChangeSubscription(user,
|
.checkPermissionToChangeSubscription(user,
|
||||||
PENDING_SUBSCRIPTION_AWAITING_APPROVAL,
|
PENDING_SUBSCRIPTION_AWAITING_APPROVAL,
|
||||||
subscription).isAuthorized();
|
subscription).isAuthorized();
|
||||||
|
@ -514,7 +522,7 @@ public class SubscriptionService implements ISubscriptionService {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (VizException e) {
|
} catch (AuthException e) {
|
||||||
statusHandler.handle(Priority.INFO,
|
statusHandler.handle(Priority.INFO,
|
||||||
e.getLocalizedMessage(), e);
|
e.getLocalizedMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ import org.eclipse.swt.widgets.Table;
|
||||||
import org.eclipse.swt.widgets.TableColumn;
|
import org.eclipse.swt.widgets.TableColumn;
|
||||||
import org.eclipse.swt.widgets.TableItem;
|
import org.eclipse.swt.widgets.TableItem;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.auth.AuthException;
|
||||||
import com.raytheon.uf.common.auth.user.IUser;
|
import com.raytheon.uf.common.auth.user.IUser;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.PendingSubscription;
|
import com.raytheon.uf.common.datadelivery.registry.PendingSubscription;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||||
|
@ -56,7 +57,6 @@ import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.viz.core.VizApp;
|
import com.raytheon.uf.viz.core.VizApp;
|
||||||
import com.raytheon.uf.viz.core.auth.UserController;
|
import com.raytheon.uf.viz.core.auth.UserController;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
|
||||||
import com.raytheon.uf.viz.core.notification.NotificationMessage;
|
import com.raytheon.uf.viz.core.notification.NotificationMessage;
|
||||||
import com.raytheon.uf.viz.core.notification.NotificationMessageContainsType;
|
import com.raytheon.uf.viz.core.notification.NotificationMessageContainsType;
|
||||||
import com.raytheon.uf.viz.datadelivery.common.ui.IGroupAction;
|
import com.raytheon.uf.viz.datadelivery.common.ui.IGroupAction;
|
||||||
|
@ -104,10 +104,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils.TABLE_TYPE;
|
||||||
* May 28, 2013 1650 djohnson More information when failing to schedule subscriptions.
|
* May 28, 2013 1650 djohnson More information when failing to schedule subscriptions.
|
||||||
* Jun 14, 2013 2064 mpduff Null check for sorted column.
|
* Jun 14, 2013 2064 mpduff Null check for sorted column.
|
||||||
* Jul 29, 2013 2232 mpduff IndexOutOfBoundsException check.
|
* Jul 29, 2013 2232 mpduff IndexOutOfBoundsException check.
|
||||||
*
|
* Jul 26, 2031 2232 mpduff Refactored Data Delivery permissions.
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @author lvenable
|
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -220,10 +217,11 @@ public class SubscriptionTableComp extends TableComp implements IGroupAction {
|
||||||
* the subscription
|
* the subscription
|
||||||
*/
|
*/
|
||||||
public void editSubscription(Subscription subscription) {
|
public void editSubscription(Subscription subscription) {
|
||||||
final DataDeliveryPermission permission = DataDeliveryPermission.SUBSCRIPTION_CREATE;
|
final String permission = DataDeliveryPermission.SUBSCRIPTION_EDIT
|
||||||
|
.toString();
|
||||||
IUser user = UserController.getUserObject();
|
IUser user = UserController.getUserObject();
|
||||||
String msg = user.uniqueId()
|
String msg = user.uniqueId()
|
||||||
+ " is not authorized to access the Dataset Discovery Browser\nPermission: "
|
+ " is not authorized to edit existing subscriptions.\nPermission: "
|
||||||
+ permission;
|
+ permission;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -234,7 +232,7 @@ public class SubscriptionTableComp extends TableComp implements IGroupAction {
|
||||||
|
|
||||||
dlg.open();
|
dlg.open();
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (AuthException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
"Error occurred in authorization request", e);
|
"Error occurred in authorization request", e);
|
||||||
}
|
}
|
||||||
|
@ -274,7 +272,8 @@ public class SubscriptionTableComp extends TableComp implements IGroupAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check permissions
|
// Check permissions
|
||||||
final DataDeliveryPermission permission = DataDeliveryPermission.SUBSCRIPTION_EDIT;
|
final String permission = DataDeliveryPermission.SUBSCRIPTION_EDIT
|
||||||
|
.toString();
|
||||||
IUser user = UserController.getUserObject();
|
IUser user = UserController.getUserObject();
|
||||||
String msg = user.uniqueId()
|
String msg = user.uniqueId()
|
||||||
+ " is not authorized to access Group Add\nPermission: "
|
+ " is not authorized to access Group Add\nPermission: "
|
||||||
|
@ -288,7 +287,7 @@ public class SubscriptionTableComp extends TableComp implements IGroupAction {
|
||||||
getSelectedSubscription(), this);
|
getSelectedSubscription(), this);
|
||||||
groupAdd.open();
|
groupAdd.open();
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (AuthException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
"Error occurred in authorization request", e);
|
"Error occurred in authorization request", e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,9 @@ import org.eclipse.swt.widgets.Menu;
|
||||||
import org.eclipse.swt.widgets.MenuItem;
|
import org.eclipse.swt.widgets.MenuItem;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.auth.AuthException;
|
||||||
|
import com.raytheon.uf.common.auth.req.IPermissionsService;
|
||||||
|
import com.raytheon.uf.common.auth.req.IPermissionsService.IAuthorizedPermissionResponse;
|
||||||
import com.raytheon.uf.common.auth.user.IUser;
|
import com.raytheon.uf.common.auth.user.IUser;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.InitialPendingSubscription;
|
import com.raytheon.uf.common.datadelivery.registry.InitialPendingSubscription;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.PendingSubscription;
|
import com.raytheon.uf.common.datadelivery.registry.PendingSubscription;
|
||||||
|
@ -48,7 +51,6 @@ import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.viz.core.VizApp;
|
import com.raytheon.uf.viz.core.VizApp;
|
||||||
import com.raytheon.uf.viz.core.auth.UserController;
|
import com.raytheon.uf.viz.core.auth.UserController;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
|
||||||
import com.raytheon.uf.viz.core.notification.INotificationObserver;
|
import com.raytheon.uf.viz.core.notification.INotificationObserver;
|
||||||
import com.raytheon.uf.viz.core.notification.NotificationException;
|
import com.raytheon.uf.viz.core.notification.NotificationException;
|
||||||
import com.raytheon.uf.viz.core.notification.NotificationMessage;
|
import com.raytheon.uf.viz.core.notification.NotificationMessage;
|
||||||
|
@ -57,8 +59,6 @@ import com.raytheon.uf.viz.datadelivery.common.ui.TableDataManager;
|
||||||
import com.raytheon.uf.viz.datadelivery.help.HelpManager;
|
import com.raytheon.uf.viz.datadelivery.help.HelpManager;
|
||||||
import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
|
import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
|
||||||
import com.raytheon.uf.viz.datadelivery.subscription.CancelForceApplyAndIncreaseLatencyDisplayText;
|
import com.raytheon.uf.viz.datadelivery.subscription.CancelForceApplyAndIncreaseLatencyDisplayText;
|
||||||
import com.raytheon.uf.viz.datadelivery.subscription.IPermissionsService;
|
|
||||||
import com.raytheon.uf.viz.datadelivery.subscription.IPermissionsService.IAuthorizedPermissionResponse;
|
|
||||||
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionService;
|
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionService;
|
||||||
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionService.ISubscriptionServiceResult;
|
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionService.ISubscriptionServiceResult;
|
||||||
import com.raytheon.uf.viz.datadelivery.subscription.SubscriptionService.ForceApplyPromptResponse;
|
import com.raytheon.uf.viz.datadelivery.subscription.SubscriptionService.ForceApplyPromptResponse;
|
||||||
|
@ -92,6 +92,7 @@ import com.raytheon.viz.ui.presenter.IDisplay;
|
||||||
* Mar 29, 2013 1841 djohnson Subscription is now UserSubscription.
|
* Mar 29, 2013 1841 djohnson Subscription is now UserSubscription.
|
||||||
* Apr 05, 2013 1841 djohnson Add support for shared subscriptions.
|
* Apr 05, 2013 1841 djohnson Add support for shared subscriptions.
|
||||||
* Jun 06, 2013 2030 mpduff Refactored help.
|
* Jun 06, 2013 2030 mpduff Refactored help.
|
||||||
|
* Jul 26, 2031 2232 mpduff Refactored Data Delivery permissions.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -352,7 +353,8 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements
|
||||||
boolean site = false;
|
boolean site = false;
|
||||||
|
|
||||||
if (response
|
if (response
|
||||||
.hasPermission(DataDeliveryPermission.SUBSCRIPTION_APPROVE_SITE)) {
|
.hasPermission(DataDeliveryPermission.SUBSCRIPTION_APPROVE_SITE
|
||||||
|
.toString())) {
|
||||||
site = true;
|
site = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -402,10 +404,13 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements
|
||||||
String msg = user.uniqueId()
|
String msg = user.uniqueId()
|
||||||
+ " is not authorized to Approve/Deny subscriptions.";
|
+ " is not authorized to Approve/Deny subscriptions.";
|
||||||
|
|
||||||
return permissionsService.checkPermissions(user, msg,
|
return permissionsService
|
||||||
DataDeliveryPermission.SUBSCRIPTION_APPROVE_SITE,
|
.checkPermissions(user, msg,
|
||||||
DataDeliveryPermission.SUBSCRIPTION_APPROVE_USER);
|
DataDeliveryPermission.SUBSCRIPTION_APPROVE_SITE
|
||||||
} catch (VizException e) {
|
.toString(),
|
||||||
|
DataDeliveryPermission.SUBSCRIPTION_APPROVE_USER
|
||||||
|
.toString());
|
||||||
|
} catch (AuthException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
"Unable to check user permissions.", e);
|
"Unable to check user permissions.", e);
|
||||||
return new IAuthorizedPermissionResponse() {
|
return new IAuthorizedPermissionResponse() {
|
||||||
|
@ -415,7 +420,7 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasPermission(DataDeliveryPermission permission) {
|
public boolean hasPermission(String permission) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -441,7 +446,8 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements
|
||||||
boolean site = false;
|
boolean site = false;
|
||||||
|
|
||||||
if (response
|
if (response
|
||||||
.hasPermission(DataDeliveryPermission.SUBSCRIPTION_APPROVE_SITE)) {
|
.hasPermission(DataDeliveryPermission.SUBSCRIPTION_APPROVE_SITE
|
||||||
|
.toString())) {
|
||||||
site = true;
|
site = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,8 @@ import org.eclipse.swt.widgets.Shell;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
import com.raytheon.uf.common.auth.AuthException;
|
||||||
|
import com.raytheon.uf.common.auth.req.IPermissionsService;
|
||||||
import com.raytheon.uf.common.auth.user.IUser;
|
import com.raytheon.uf.common.auth.user.IUser;
|
||||||
import com.raytheon.uf.common.datadelivery.bandwidth.data.SubscriptionStatusSummary;
|
import com.raytheon.uf.common.datadelivery.bandwidth.data.SubscriptionStatusSummary;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.DataSet;
|
import com.raytheon.uf.common.datadelivery.registry.DataSet;
|
||||||
|
@ -66,13 +68,13 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||||
import com.raytheon.uf.viz.core.IGuiThreadTaskExecutor;
|
import com.raytheon.uf.viz.core.IGuiThreadTaskExecutor;
|
||||||
import com.raytheon.uf.viz.core.auth.UserController;
|
import com.raytheon.uf.viz.core.auth.UserController;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
|
||||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||||
import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
|
import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
|
||||||
import com.raytheon.uf.viz.datadelivery.subscription.CancelForceApplyAndIncreaseLatencyDisplayText;
|
import com.raytheon.uf.viz.datadelivery.subscription.CancelForceApplyAndIncreaseLatencyDisplayText;
|
||||||
import com.raytheon.uf.viz.datadelivery.subscription.GroupDefinitionManager;
|
import com.raytheon.uf.viz.datadelivery.subscription.GroupDefinitionManager;
|
||||||
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionService;
|
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionService;
|
||||||
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionService.ISubscriptionServiceResult;
|
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionService.ISubscriptionServiceResult;
|
||||||
|
import com.raytheon.uf.viz.datadelivery.subscription.RequestFromServerPermissionsService;
|
||||||
import com.raytheon.uf.viz.datadelivery.subscription.SubscriptionStatusDlg;
|
import com.raytheon.uf.viz.datadelivery.subscription.SubscriptionStatusDlg;
|
||||||
import com.raytheon.uf.viz.datadelivery.subscription.view.ICreateSubscriptionDlgView;
|
import com.raytheon.uf.viz.datadelivery.subscription.view.ICreateSubscriptionDlgView;
|
||||||
import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryGUIUtils;
|
import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryGUIUtils;
|
||||||
|
@ -117,6 +119,7 @@ import com.raytheon.viz.ui.presenter.components.ComboBoxConf;
|
||||||
* May 15, 2013 1040 mpduff Add shared sites.
|
* May 15, 2013 1040 mpduff Add shared sites.
|
||||||
* Jun 04, 2013 223 mpduff Add point data.
|
* Jun 04, 2013 223 mpduff Add point data.
|
||||||
* Jul 18, 2013 1653 mpduff Add SubscriptionStatusSummary and the display dialog.
|
* Jul 18, 2013 1653 mpduff Add SubscriptionStatusSummary and the display dialog.
|
||||||
|
* Jul 26, 2031 2232 mpduff Refactored Data Delivery permissions.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author mpduff
|
* @author mpduff
|
||||||
|
@ -545,126 +548,127 @@ public class CreateSubscriptionDlgPresenter {
|
||||||
String currentUser = LocalizationManager.getInstance().getCurrentUser();
|
String currentUser = LocalizationManager.getInstance().getCurrentUser();
|
||||||
final String username = user.uniqueId().toString();
|
final String username = user.uniqueId().toString();
|
||||||
|
|
||||||
if (this.create) {
|
// Check for permission
|
||||||
|
IPermissionsService permissionsService = DataDeliveryServices
|
||||||
|
.getPermissionsService();
|
||||||
|
boolean autoApprove = false;
|
||||||
|
if (permissionsService instanceof RequestFromServerPermissionsService) {
|
||||||
try {
|
try {
|
||||||
boolean autoApprove = DataDeliveryServices
|
// check to see if user is authorized to approve. If so then
|
||||||
.getPermissionsService()
|
// auto-approve
|
||||||
|
autoApprove = ((RequestFromServerPermissionsService) permissionsService)
|
||||||
.checkPermissionToChangeSubscription(user,
|
.checkPermissionToChangeSubscription(user,
|
||||||
PENDING_APPROVAL_MESSAGE, subscription)
|
PENDING_APPROVAL_MESSAGE, subscription)
|
||||||
.isAuthorized();
|
.isAuthorized();
|
||||||
|
} catch (AuthException e) {
|
||||||
setSubscriptionId(subscription);
|
|
||||||
|
|
||||||
if (autoApprove) {
|
|
||||||
final BlockingQueue<SubscriptionStatusSummary> exchanger = new ArrayBlockingQueue<SubscriptionStatusSummary>(
|
|
||||||
1);
|
|
||||||
|
|
||||||
final Shell jobShell = view.getShell();
|
|
||||||
Job job = new Job("Creating Subscription...") {
|
|
||||||
@Override
|
|
||||||
protected IStatus run(IProgressMonitor monitor) {
|
|
||||||
DataDeliveryGUIUtils.markBusyInUIThread(jobShell);
|
|
||||||
ISubscriptionServiceResult result = storeSubscription(
|
|
||||||
subscription, username);
|
|
||||||
if (result != null) {
|
|
||||||
if (result.isAllowFurtherEditing()) {
|
|
||||||
return new Status(
|
|
||||||
Status.CANCEL,
|
|
||||||
CreateSubscriptionDlgPresenter.class
|
|
||||||
.getName(), result
|
|
||||||
.getMessageToDisplay());
|
|
||||||
} else {
|
|
||||||
SubscriptionStatusSummary sum = result
|
|
||||||
.getSubscriptionStatusSummary();
|
|
||||||
|
|
||||||
exchanger.add(sum);
|
|
||||||
return new Status(
|
|
||||||
Status.OK,
|
|
||||||
CreateSubscriptionDlgPresenter.class
|
|
||||||
.getName(), result
|
|
||||||
.getMessageToDisplay());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return new Status(Status.ERROR,
|
|
||||||
CreateSubscriptionDlgPresenter.class
|
|
||||||
.getName(),
|
|
||||||
"Error Storing Subscription");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
job.addJobChangeListener(new JobChangeAdapter() {
|
|
||||||
@Override
|
|
||||||
public void done(final IJobChangeEvent event) {
|
|
||||||
try {
|
|
||||||
final IStatus status = event.getResult();
|
|
||||||
|
|
||||||
final boolean subscriptionCreated = status
|
|
||||||
.isOK();
|
|
||||||
if (subscriptionCreated) {
|
|
||||||
sendSubscriptionNotification(subscription,
|
|
||||||
username);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Strings.isNullOrEmpty(status.getMessage())) {
|
|
||||||
guiThreadTaskExecutor
|
|
||||||
.runAsync(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (!view.isDisposed()) {
|
|
||||||
if (subscriptionCreated) {
|
|
||||||
try {
|
|
||||||
displaySummary(
|
|
||||||
exchanger
|
|
||||||
.take(),
|
|
||||||
status.getMessage());
|
|
||||||
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
statusHandler
|
|
||||||
.handle(Priority.PROBLEM,
|
|
||||||
e.getLocalizedMessage(),
|
|
||||||
e);
|
|
||||||
}
|
|
||||||
view.setStatus(Status.OK);
|
|
||||||
view.closeDlg();
|
|
||||||
} else {
|
|
||||||
view.setStatus(Status.CANCEL);
|
|
||||||
view.displayPopup(
|
|
||||||
"Unable to Create Subscription",
|
|
||||||
status.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
DataDeliveryGUIUtils
|
|
||||||
.markNotBusyInUIThread(jobShell);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
job.schedule();
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
InitialPendingSubscription pendingSub = subscription
|
|
||||||
.initialPending(currentUser);
|
|
||||||
|
|
||||||
try {
|
|
||||||
handler.store(pendingSub);
|
|
||||||
|
|
||||||
this.subscription = pendingSub;
|
|
||||||
|
|
||||||
subscriptionNotificationService
|
|
||||||
.sendCreatedPendingSubscriptionNotification(
|
|
||||||
pendingSub, username);
|
|
||||||
} catch (RegistryHandlerException e) {
|
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
|
||||||
"Unable to create pending subscription.", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (VizException e) {
|
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
||||||
e);
|
e);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.create) {
|
||||||
|
setSubscriptionId(subscription);
|
||||||
|
if (autoApprove) {
|
||||||
|
final BlockingQueue<SubscriptionStatusSummary> exchanger = new ArrayBlockingQueue<SubscriptionStatusSummary>(
|
||||||
|
1);
|
||||||
|
|
||||||
|
final Shell jobShell = view.getShell();
|
||||||
|
Job job = new Job("Creating Subscription...") {
|
||||||
|
@Override
|
||||||
|
protected IStatus run(IProgressMonitor monitor) {
|
||||||
|
DataDeliveryGUIUtils.markBusyInUIThread(jobShell);
|
||||||
|
ISubscriptionServiceResult result = storeSubscription(
|
||||||
|
subscription, username);
|
||||||
|
if (result != null) {
|
||||||
|
if (result.isAllowFurtherEditing()) {
|
||||||
|
return new Status(Status.CANCEL,
|
||||||
|
CreateSubscriptionDlgPresenter.class
|
||||||
|
.getName(),
|
||||||
|
result.getMessageToDisplay());
|
||||||
|
} else {
|
||||||
|
SubscriptionStatusSummary sum = result
|
||||||
|
.getSubscriptionStatusSummary();
|
||||||
|
|
||||||
|
exchanger.add(sum);
|
||||||
|
return new Status(Status.OK,
|
||||||
|
CreateSubscriptionDlgPresenter.class
|
||||||
|
.getName(),
|
||||||
|
result.getMessageToDisplay());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return new Status(Status.ERROR,
|
||||||
|
CreateSubscriptionDlgPresenter.class
|
||||||
|
.getName(),
|
||||||
|
"Error Storing Subscription");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
job.addJobChangeListener(new JobChangeAdapter() {
|
||||||
|
@Override
|
||||||
|
public void done(final IJobChangeEvent event) {
|
||||||
|
try {
|
||||||
|
final IStatus status = event.getResult();
|
||||||
|
|
||||||
|
final boolean subscriptionCreated = status.isOK();
|
||||||
|
if (subscriptionCreated) {
|
||||||
|
sendSubscriptionNotification(subscription,
|
||||||
|
username);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Strings.isNullOrEmpty(status.getMessage())) {
|
||||||
|
guiThreadTaskExecutor.runAsync(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (!view.isDisposed()) {
|
||||||
|
if (subscriptionCreated) {
|
||||||
|
try {
|
||||||
|
displaySummary(
|
||||||
|
exchanger.take(),
|
||||||
|
status.getMessage());
|
||||||
|
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
statusHandler.handle(
|
||||||
|
Priority.PROBLEM,
|
||||||
|
e.getLocalizedMessage(),
|
||||||
|
e);
|
||||||
|
}
|
||||||
|
view.setStatus(Status.OK);
|
||||||
|
view.closeDlg();
|
||||||
|
} else {
|
||||||
|
view.setStatus(Status.CANCEL);
|
||||||
|
view.displayPopup(
|
||||||
|
"Unable to Create Subscription",
|
||||||
|
status.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
DataDeliveryGUIUtils
|
||||||
|
.markNotBusyInUIThread(jobShell);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
job.schedule();
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
InitialPendingSubscription pendingSub = subscription
|
||||||
|
.initialPending(currentUser);
|
||||||
|
|
||||||
|
try {
|
||||||
|
handler.store(pendingSub);
|
||||||
|
|
||||||
|
this.subscription = pendingSub;
|
||||||
|
|
||||||
|
subscriptionNotificationService
|
||||||
|
.sendCreatedPendingSubscriptionNotification(
|
||||||
|
pendingSub, username);
|
||||||
|
} catch (RegistryHandlerException e) {
|
||||||
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
|
"Unable to create pending subscription.", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Check for pending subscription, can only have one pending change
|
// Check for pending subscription, can only have one pending change
|
||||||
PendingSubscription pendingSub = subscription
|
PendingSubscription pendingSub = subscription
|
||||||
|
@ -692,61 +696,47 @@ public class CreateSubscriptionDlgPresenter {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check to see if user is authorized to approve. If so then
|
if (autoApprove) {
|
||||||
// auto-approve
|
try {
|
||||||
try {
|
final ISubscriptionServiceResult response = subscriptionService
|
||||||
boolean autoApprove = DataDeliveryServices
|
.update(subscription,
|
||||||
.getPermissionsService()
|
new CancelForceApplyAndIncreaseLatencyDisplayText(
|
||||||
.checkPermissionToChangeSubscription(user,
|
"update", view.getShell()));
|
||||||
PENDING_APPROVAL_MESSAGE, subscription)
|
if (response.hasMessageToDisplay()) {
|
||||||
.isAuthorized();
|
view.displayPopup(UPDATED_TITLE,
|
||||||
|
response.getMessageToDisplay());
|
||||||
if (autoApprove) {
|
|
||||||
try {
|
|
||||||
final ISubscriptionServiceResult response = subscriptionService
|
|
||||||
.update(subscription,
|
|
||||||
new CancelForceApplyAndIncreaseLatencyDisplayText(
|
|
||||||
"update", view.getShell()));
|
|
||||||
if (response.hasMessageToDisplay()) {
|
|
||||||
view.displayPopup(UPDATED_TITLE,
|
|
||||||
response.getMessageToDisplay());
|
|
||||||
}
|
|
||||||
|
|
||||||
// If there was a force apply prompt, and the user
|
|
||||||
// selects no, then we want to allow them to
|
|
||||||
// continue editing the subscription
|
|
||||||
if (response.isAllowFurtherEditing()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
subscriptionNotificationService
|
|
||||||
.sendUpdatedSubscriptionNotification(
|
|
||||||
subscription, username);
|
|
||||||
|
|
||||||
} catch (RegistryHandlerException e) {
|
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
|
||||||
"Unable to update subscription.", e);
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
setSubscriptionId(subscription);
|
|
||||||
try {
|
|
||||||
pendingSubHandler.update(pendingSub);
|
|
||||||
|
|
||||||
subscriptionNotificationService
|
// If there was a force apply prompt, and the user
|
||||||
.sendCreatedPendingSubscriptionForSubscriptionNotification(
|
// selects no, then we want to allow them to
|
||||||
pendingSub, username);
|
// continue editing the subscription
|
||||||
|
if (response.isAllowFurtherEditing()) {
|
||||||
final String msg = PENDING_APPROVAL_MESSAGE;
|
return false;
|
||||||
view.displayPopup("Subscription Pending", msg);
|
|
||||||
} catch (RegistryHandlerException e) {
|
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
|
||||||
"Unable to create pending subscription.", e);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
subscriptionNotificationService
|
||||||
|
.sendUpdatedSubscriptionNotification(subscription,
|
||||||
|
username);
|
||||||
|
|
||||||
|
} catch (RegistryHandlerException e) {
|
||||||
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
|
"Unable to update subscription.", e);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
setSubscriptionId(subscription);
|
||||||
|
try {
|
||||||
|
pendingSubHandler.update(pendingSub);
|
||||||
|
|
||||||
} catch (VizException e) {
|
subscriptionNotificationService
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
.sendCreatedPendingSubscriptionForSubscriptionNotification(
|
||||||
e);
|
pendingSub, username);
|
||||||
|
|
||||||
|
final String msg = PENDING_APPROVAL_MESSAGE;
|
||||||
|
view.displayPopup("Subscription Pending", msg);
|
||||||
|
} catch (RegistryHandlerException e) {
|
||||||
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
|
"Unable to create pending subscription.", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,13 +30,13 @@ import org.eclipse.swt.widgets.Button;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.List;
|
import org.eclipse.swt.widgets.List;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.auth.AuthException;
|
||||||
import com.raytheon.uf.common.auth.user.IUser;
|
import com.raytheon.uf.common.auth.user.IUser;
|
||||||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
|
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.viz.core.auth.UserController;
|
import com.raytheon.uf.viz.core.auth.UserController;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
|
||||||
import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
|
import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
|
||||||
import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils;
|
import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils;
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* May 17, 2013 2000 djohnson Consolidate duplicate code from latency and priority versions.
|
* May 17, 2013 2000 djohnson Consolidate duplicate code from latency and priority versions.
|
||||||
|
* Jul 26, 2031 2232 mpduff Refactored Data Delivery permissions.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -129,8 +130,8 @@ public abstract class SystemRulesTab extends SystemTab {
|
||||||
gd.widthHint = 375;
|
gd.widthHint = 375;
|
||||||
gd.heightHint = 200;
|
gd.heightHint = 200;
|
||||||
|
|
||||||
rulesList = new List(listComp, SWT.BORDER | SWT.MULTI
|
rulesList = new List(listComp, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL
|
||||||
| SWT.V_SCROLL | SWT.H_SCROLL | SWT.SINGLE);
|
| SWT.H_SCROLL | SWT.SINGLE);
|
||||||
rulesList.setLayoutData(gd);
|
rulesList.setLayoutData(gd);
|
||||||
rulesList.addSelectionListener(new SelectionAdapter() {
|
rulesList.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -237,7 +238,8 @@ public abstract class SystemRulesTab extends SystemTab {
|
||||||
* New/Edit rule action handler.
|
* New/Edit rule action handler.
|
||||||
*/
|
*/
|
||||||
private void handleRule() {
|
private void handleRule() {
|
||||||
final DataDeliveryPermission permission = DataDeliveryPermission.SYSTEM_MANAGEMENT_CREATE;
|
final String permission = DataDeliveryPermission.SYSTEM_MANAGEMENT_CREATE
|
||||||
|
.toString();
|
||||||
IUser user = UserController.getUserObject();
|
IUser user = UserController.getUserObject();
|
||||||
String msg = user.uniqueId() + notAuthorizedMsg + permission;
|
String msg = user.uniqueId() + notAuthorizedMsg + permission;
|
||||||
|
|
||||||
|
@ -278,7 +280,7 @@ public abstract class SystemRulesTab extends SystemTab {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (AuthException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
"Error occurred in authorization request", e);
|
"Error occurred in authorization request", e);
|
||||||
}
|
}
|
||||||
|
@ -288,7 +290,8 @@ public abstract class SystemRulesTab extends SystemTab {
|
||||||
* Delete rule action handler.
|
* Delete rule action handler.
|
||||||
*/
|
*/
|
||||||
private void handleDeleteRule() {
|
private void handleDeleteRule() {
|
||||||
final DataDeliveryPermission permission = DataDeliveryPermission.SYSTEM_MANAGEMENT_CREATE;
|
final String permission = DataDeliveryPermission.SYSTEM_MANAGEMENT_CREATE
|
||||||
|
.toString();
|
||||||
IUser user = UserController.getUserObject();
|
IUser user = UserController.getUserObject();
|
||||||
String msg = user.uniqueId() + notAuthorizedMsg + permission;
|
String msg = user.uniqueId() + notAuthorizedMsg + permission;
|
||||||
|
|
||||||
|
@ -317,7 +320,7 @@ public abstract class SystemRulesTab extends SystemTab {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (VizException e) {
|
} catch (AuthException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
"Error occurred in authorization request", e);
|
"Error occurred in authorization request", e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,13 +40,10 @@ import com.raytheon.uf.common.datadelivery.registry.GriddedDataSet;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.Parameter;
|
import com.raytheon.uf.common.datadelivery.registry.Parameter;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.Time;
|
import com.raytheon.uf.common.datadelivery.registry.Time;
|
||||||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryAuthRequest;
|
|
||||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||||
import com.raytheon.uf.common.util.CollectionUtil;
|
import com.raytheon.uf.common.util.CollectionUtil;
|
||||||
import com.raytheon.uf.common.util.SizeUtil;
|
import com.raytheon.uf.common.util.SizeUtil;
|
||||||
import com.raytheon.uf.common.util.StringUtil;
|
import com.raytheon.uf.common.util.StringUtil;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
|
||||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
|
||||||
import com.raytheon.uf.viz.datadelivery.subscription.SubscriptionManagerRowData;
|
import com.raytheon.uf.viz.datadelivery.subscription.SubscriptionManagerRowData;
|
||||||
import com.raytheon.uf.viz.datadelivery.subscription.approve.SubscriptionApprovalRowData;
|
import com.raytheon.uf.viz.datadelivery.subscription.approve.SubscriptionApprovalRowData;
|
||||||
import com.vividsolutions.jts.geom.Coordinate;
|
import com.vividsolutions.jts.geom.Coordinate;
|
||||||
|
@ -79,6 +76,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* Jun 04, 2013 223 mpduff Add point data stuff.
|
* Jun 04, 2013 223 mpduff Add point data stuff.
|
||||||
* Jun 11, 2013 2064 mpduff Don't output Parameter header if none exist.
|
* Jun 11, 2013 2064 mpduff Don't output Parameter header if none exist.
|
||||||
* Jun 12, 2013 2064 mpduff Use SizeUtil to format data size output.
|
* Jun 12, 2013 2064 mpduff Use SizeUtil to format data size output.
|
||||||
|
* Jul 26, 2031 2232 mpduff Removed sendAuthorizationRequest method.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author mpduff
|
* @author mpduff
|
||||||
|
@ -742,20 +740,6 @@ public class DataDeliveryUtils {
|
||||||
return StringUtil.getIndentedList(list, " ");
|
return StringUtil.getIndentedList(list, " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Send an authorization request
|
|
||||||
*
|
|
||||||
* @param request
|
|
||||||
* The request object
|
|
||||||
* @return DataDeliveryAuthReqeust object
|
|
||||||
* @throws VizException
|
|
||||||
*/
|
|
||||||
public static DataDeliveryAuthRequest sendAuthorizationRequest(
|
|
||||||
DataDeliveryAuthRequest request) throws VizException {
|
|
||||||
return (DataDeliveryAuthRequest) ThriftClient
|
|
||||||
.sendPrivilegedRequest(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the maximum latency for the provided subscription. Calculated as the
|
* Get the maximum latency for the provided subscription. Calculated as the
|
||||||
* maximum cyclic difference.
|
* maximum cyclic difference.
|
||||||
|
|
|
@ -53,6 +53,7 @@ import com.raytheon.viz.ui.widgets.duallist.IUpdate;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* May 23, 2012 mpduff Initial creation
|
* May 23, 2012 mpduff Initial creation
|
||||||
* Aug 08, 2012 863 jpiatt Added new interface method.
|
* Aug 08, 2012 863 jpiatt Added new interface method.
|
||||||
|
* Jul 28, 2013 2236 mpduff Made resizable.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -61,7 +62,7 @@ import com.raytheon.viz.ui.widgets.duallist.IUpdate;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ManageUserDlg extends CaveSWTDialog implements IUpdate {
|
public class ManageUserDlg extends CaveSWTDialog implements IUpdate {
|
||||||
|
|
||||||
/** The Stack Layout. */
|
/** The Stack Layout. */
|
||||||
private final StackLayout stackLayout = new StackLayout();
|
private final StackLayout stackLayout = new StackLayout();
|
||||||
|
|
||||||
|
@ -79,26 +80,31 @@ public class ManageUserDlg extends CaveSWTDialog implements IUpdate {
|
||||||
|
|
||||||
/** Permissions dual list */
|
/** Permissions dual list */
|
||||||
private DualList permDualList;
|
private DualList permDualList;
|
||||||
|
|
||||||
/** User role dual list */
|
/** User role dual list */
|
||||||
private DualList userRoleDualList;
|
private DualList userRoleDualList;
|
||||||
|
|
||||||
/** Stack composite */
|
/** Stack composite */
|
||||||
private Composite stackComp;
|
private Composite stackComp;
|
||||||
|
|
||||||
/** The application currently selected.*/
|
/** The application currently selected. */
|
||||||
private final String application;
|
private final String application;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param parent parent shell
|
* @param parent
|
||||||
* @param type type of data being edited
|
* parent shell
|
||||||
* @param selection selection being passed in
|
* @param type
|
||||||
* @param application application working on
|
* type of data being edited
|
||||||
|
* @param selection
|
||||||
|
* selection being passed in
|
||||||
|
* @param application
|
||||||
|
* application working on
|
||||||
*/
|
*/
|
||||||
public ManageUserDlg(Shell parent, String type, String selection, String application) {
|
public ManageUserDlg(Shell parent, String type, String selection,
|
||||||
super(parent, SWT.DIALOG_TRIM);
|
String application) {
|
||||||
|
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE);
|
||||||
this.selection = selection;
|
this.selection = selection;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.application = application;
|
this.application = application;
|
||||||
|
@ -137,33 +143,39 @@ public class ManageUserDlg extends CaveSWTDialog implements IUpdate {
|
||||||
|
|
||||||
String[] entries;
|
String[] entries;
|
||||||
if (type.equalsIgnoreCase("Role")) {
|
if (type.equalsIgnoreCase("Role")) {
|
||||||
entries = new String[] { "Assigned Roles", "Assigned Permissions", "Assign Role to Users" };
|
entries = new String[] { "Assigned Roles", "Assigned Permissions",
|
||||||
|
"Assign Role to Users" };
|
||||||
} else {
|
} else {
|
||||||
entries = new String[] { "Assigned Roles", "Assigned Permissions" };
|
entries = new String[] { "Assigned Roles", "Assigned Permissions" };
|
||||||
}
|
}
|
||||||
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
|
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
|
||||||
editCbo = new Combo(labelComp, SWT.DROP_DOWN | SWT.READ_ONLY);
|
editCbo = new Combo(labelComp, SWT.DROP_DOWN | SWT.READ_ONLY);
|
||||||
editCbo.setLayoutData(gd);
|
editCbo.setLayoutData(gd);
|
||||||
|
|
||||||
editCbo.setItems(entries);
|
editCbo.setItems(entries);
|
||||||
editCbo.select(0);
|
editCbo.select(0);
|
||||||
editCbo.addSelectionListener(new SelectionAdapter() {
|
editCbo.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
if (editCbo.getItem(editCbo.getSelectionIndex()).equals("Assigned Roles")) {
|
if (editCbo.getItem(editCbo.getSelectionIndex()).equals(
|
||||||
|
"Assigned Roles")) {
|
||||||
stackLayout.topControl = roleDualList;
|
stackLayout.topControl = roleDualList;
|
||||||
} else if (editCbo.getItem(editCbo.getSelectionIndex()).equals("Assigned Permissions")) {
|
} else if (editCbo.getItem(editCbo.getSelectionIndex()).equals(
|
||||||
|
"Assigned Permissions")) {
|
||||||
stackLayout.topControl = permDualList;
|
stackLayout.topControl = permDualList;
|
||||||
} else if (editCbo.getItem(editCbo.getSelectionIndex()).equals("Assign Role to Users")) {
|
} else if (editCbo.getItem(editCbo.getSelectionIndex()).equals(
|
||||||
|
"Assign Role to Users")) {
|
||||||
stackLayout.topControl = userRoleDualList;
|
stackLayout.topControl = userRoleDualList;
|
||||||
}
|
}
|
||||||
|
|
||||||
stackComp.layout();
|
stackComp.layout();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||||
stackComp = new Composite(shell, SWT.NONE);
|
stackComp = new Composite(shell, SWT.NONE);
|
||||||
stackComp.setLayout(stackLayout);
|
stackComp.setLayout(stackLayout);
|
||||||
|
stackComp.setLayoutData(gd);
|
||||||
|
|
||||||
NwsRoleDataManager manager = NwsRoleDataManager.getInstance();
|
NwsRoleDataManager manager = NwsRoleDataManager.getInstance();
|
||||||
ArrayList<String> selectedList = new ArrayList<String>();
|
ArrayList<String> selectedList = new ArrayList<String>();
|
||||||
|
@ -172,7 +184,8 @@ public class ManageUserDlg extends CaveSWTDialog implements IUpdate {
|
||||||
String selectedLabel = "Selected Roles:";
|
String selectedLabel = "Selected Roles:";
|
||||||
|
|
||||||
// build roles widgets
|
// build roles widgets
|
||||||
String[] userRoles = manager.getRoleData(application).getUserRoles(this.selection);
|
String[] userRoles = manager.getRoleData(application).getUserRoles(
|
||||||
|
this.selection);
|
||||||
for (String role : userRoles) {
|
for (String role : userRoles) {
|
||||||
selectedList.add(role);
|
selectedList.add(role);
|
||||||
}
|
}
|
||||||
|
@ -181,7 +194,7 @@ public class ManageUserDlg extends CaveSWTDialog implements IUpdate {
|
||||||
for (String role : roles) {
|
for (String role : roles) {
|
||||||
fullList.add(role);
|
fullList.add(role);
|
||||||
}
|
}
|
||||||
|
|
||||||
DualListMenuData menuData = new DualListMenuData();
|
DualListMenuData menuData = new DualListMenuData();
|
||||||
menuData.setApplication(this.application);
|
menuData.setApplication(this.application);
|
||||||
menuData.setMenuText("Details...");
|
menuData.setMenuText("Details...");
|
||||||
|
@ -201,7 +214,8 @@ public class ManageUserDlg extends CaveSWTDialog implements IUpdate {
|
||||||
// Build permissions widgets
|
// Build permissions widgets
|
||||||
ArrayList<String> selectedPermList = new ArrayList<String>();
|
ArrayList<String> selectedPermList = new ArrayList<String>();
|
||||||
ArrayList<String> fullPermList = new ArrayList<String>();
|
ArrayList<String> fullPermList = new ArrayList<String>();
|
||||||
String[] userPerms = manager.getRoleData(application).getUserPermissions(this.selection);
|
String[] userPerms = manager.getRoleData(application)
|
||||||
|
.getUserPermissions(this.selection);
|
||||||
for (String perm : userPerms) {
|
for (String perm : userPerms) {
|
||||||
selectedPermList.add(perm);
|
selectedPermList.add(perm);
|
||||||
}
|
}
|
||||||
|
@ -245,9 +259,10 @@ public class ManageUserDlg extends CaveSWTDialog implements IUpdate {
|
||||||
userRoleConfig.setListHeight(90);
|
userRoleConfig.setListHeight(90);
|
||||||
userRoleConfig.setListWidth(175);
|
userRoleConfig.setListWidth(175);
|
||||||
userRoleConfig.setFullList(fullUserList);
|
userRoleConfig.setFullList(fullUserList);
|
||||||
|
|
||||||
userRoleDualList = new DualList(stackComp, SWT.NONE, userRoleConfig, this);
|
userRoleDualList = new DualList(stackComp, SWT.NONE, userRoleConfig,
|
||||||
|
this);
|
||||||
|
|
||||||
int buttonWidth = 75;
|
int buttonWidth = 75;
|
||||||
GridData btnData = new GridData(buttonWidth, SWT.DEFAULT);
|
GridData btnData = new GridData(buttonWidth, SWT.DEFAULT);
|
||||||
gd = new GridData(SWT.CENTER, SWT.DEFAULT, false, false);
|
gd = new GridData(SWT.CENTER, SWT.DEFAULT, false, false);
|
||||||
|
@ -290,54 +305,56 @@ public class ManageUserDlg extends CaveSWTDialog implements IUpdate {
|
||||||
String[] selectedUsers = userRoleDualList.getSelectedListItems();
|
String[] selectedUsers = userRoleDualList.getSelectedListItems();
|
||||||
String[] permissions = permDualList.getSelectedListItems();
|
String[] permissions = permDualList.getSelectedListItems();
|
||||||
String[] roles = roleDualList.getSelectedListItems();
|
String[] roles = roleDualList.getSelectedListItems();
|
||||||
|
|
||||||
NwsRoleDataManager man = NwsRoleDataManager.getInstance();
|
NwsRoleDataManager man = NwsRoleDataManager.getInstance();
|
||||||
NwsRoleData roleData = man.getRoleData(application);
|
NwsRoleData roleData = man.getRoleData(application);
|
||||||
|
|
||||||
if (type.equalsIgnoreCase("User")) {
|
if (type.equalsIgnoreCase("User")) {
|
||||||
ArrayList<UserXML> userList = (ArrayList<UserXML>) roleData.getUserList();
|
ArrayList<UserXML> userList = (ArrayList<UserXML>) roleData
|
||||||
for (UserXML user: userList) {
|
.getUserList();
|
||||||
|
for (UserXML user : userList) {
|
||||||
if (user.getUserId().equals(selection)) {
|
if (user.getUserId().equals(selection)) {
|
||||||
// Update permissions
|
// Update permissions
|
||||||
ArrayList<String> permissionList = new ArrayList<String>();
|
ArrayList<String> permissionList = new ArrayList<String>();
|
||||||
for (String perm: permissions) {
|
for (String perm : permissions) {
|
||||||
permissionList.add(perm);
|
permissionList.add(perm);
|
||||||
}
|
}
|
||||||
user.setPermissionList(permissionList);
|
user.setPermissionList(permissionList);
|
||||||
|
|
||||||
// Update roles
|
// Update roles
|
||||||
ArrayList<String> roleList = new ArrayList<String>();
|
ArrayList<String> roleList = new ArrayList<String>();
|
||||||
for (String role: roles) {
|
for (String role : roles) {
|
||||||
roleList.add(role);
|
roleList.add(role);
|
||||||
}
|
}
|
||||||
user.setRoleList(roleList);
|
user.setRoleList(roleList);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else { // type is role
|
} else { // type is role
|
||||||
ArrayList<RoleXML> roleList = (ArrayList<RoleXML>) roleData.getRoleList();
|
ArrayList<RoleXML> roleList = (ArrayList<RoleXML>) roleData
|
||||||
for (RoleXML role: roleList) {
|
.getRoleList();
|
||||||
|
for (RoleXML role : roleList) {
|
||||||
if (role.getRoleId().equals(selection)) {
|
if (role.getRoleId().equals(selection)) {
|
||||||
// Update permissions, start by clearing the list
|
// Update permissions, start by clearing the list
|
||||||
role.getPermissionList().clear();
|
role.getPermissionList().clear();
|
||||||
for (String perm: permissions) {
|
for (String perm : permissions) {
|
||||||
if (!role.getPermissionList().contains(perm)) {
|
if (!role.getPermissionList().contains(perm)) {
|
||||||
role.addPermission(perm);
|
role.addPermission(perm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add roles
|
// Add roles
|
||||||
for (String r: roles) {
|
for (String r : roles) {
|
||||||
if (!role.getPermissionList().contains(r)) {
|
if (!role.getPermissionList().contains(r)) {
|
||||||
role.addPermission(r);
|
role.addPermission(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add role to selected users
|
// Add role to selected users
|
||||||
for (String selectedUser: selectedUsers) {
|
for (String selectedUser : selectedUsers) {
|
||||||
for (UserXML user: roleData.getUserList()) {
|
for (UserXML user : roleData.getUserList()) {
|
||||||
if (selectedUser.equals(user.getUserId())) {
|
if (selectedUser.equals(user.getUserId())) {
|
||||||
if (!user.getRoleList().contains(selection)) {
|
if (!user.getRoleList().contains(selection)) {
|
||||||
user.addRole(selection);
|
user.addRole(selection);
|
||||||
|
@ -347,10 +364,10 @@ public class ManageUserDlg extends CaveSWTDialog implements IUpdate {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void hasEntries(boolean entries) {
|
public void hasEntries(boolean entries) {
|
||||||
this.setReturnValue(true);
|
this.setReturnValue(true);
|
||||||
|
@ -359,6 +376,6 @@ public class ManageUserDlg extends CaveSWTDialog implements IUpdate {
|
||||||
@Override
|
@Override
|
||||||
public void selectionChanged() {
|
public void selectionChanged() {
|
||||||
// unused
|
// unused
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ import com.raytheon.uf.common.serialization.ExceptionWrapper;
|
||||||
import com.raytheon.uf.common.serialization.comm.response.ServerErrorResponse;
|
import com.raytheon.uf.common.serialization.comm.response.ServerErrorResponse;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send requests to a privileged service on the server.
|
* Send requests to a privileged service on the server.
|
||||||
|
@ -40,6 +41,7 @@ import com.raytheon.uf.common.status.UFStatus;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jan 23, 2013 1643 djohnson Initial creation.
|
* Jan 23, 2013 1643 djohnson Initial creation.
|
||||||
* May 20, 2013 1040 mpduff Add check for UserNotAuthorized.
|
* May 20, 2013 1040 mpduff Add check for UserNotAuthorized.
|
||||||
|
* Jul 26, 2031 2232 mpduff Improve handling of UserNotAuthorized.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -73,7 +75,13 @@ public class BasePrivilegedServerService<T extends AbstractPrivilegedRequest>
|
||||||
.unwrapThrowable(((ServerErrorResponse) object)
|
.unwrapThrowable(((ServerErrorResponse) object)
|
||||||
.getException()));
|
.getException()));
|
||||||
} else if (object instanceof UserNotAuthorized) {
|
} else if (object instanceof UserNotAuthorized) {
|
||||||
return null;
|
UserNotAuthorized na = (UserNotAuthorized) object;
|
||||||
|
|
||||||
|
// Display the not authorized message here, NwsNotAuthHandler cannot
|
||||||
|
// be accessed from here
|
||||||
|
UFStatus.getHandler(UserNotAuthorized.class).handle(
|
||||||
|
Priority.PROBLEM, na.getMessage());
|
||||||
|
return super.unwrapResponse(responseType, na.getRequest());
|
||||||
} else {
|
} else {
|
||||||
statusHandler
|
statusHandler
|
||||||
.warn(String
|
.warn(String
|
||||||
|
|
|
@ -17,12 +17,10 @@
|
||||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
* further licensing information.
|
* further licensing information.
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.viz.datadelivery.subscription;
|
package com.raytheon.uf.common.auth.req;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.auth.AuthException;
|
||||||
import com.raytheon.uf.common.auth.user.IUser;
|
import com.raytheon.uf.common.auth.user.IUser;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
|
||||||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
|
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface that defines the service to work with permissions.
|
* Interface that defines the service to work with permissions.
|
||||||
|
@ -34,6 +32,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jan 04, 2013 1441 djohnson Initial creation
|
* Jan 04, 2013 1441 djohnson Initial creation
|
||||||
|
* Jul 26, 2031 2232 mpduff Moved to common.auth.req.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -60,26 +59,9 @@ public interface IPermissionsService {
|
||||||
* the permission
|
* the permission
|
||||||
* @return true if the user had the specific permission
|
* @return true if the user had the specific permission
|
||||||
*/
|
*/
|
||||||
boolean hasPermission(DataDeliveryPermission permission);
|
boolean hasPermission(String permission);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Check whether a user has the permissions to change a subscription.
|
|
||||||
*
|
|
||||||
* @param user
|
|
||||||
* the user requesting to change the subscription
|
|
||||||
* @param notAuthorizedMessage
|
|
||||||
* the message that should be displayed if they are not
|
|
||||||
* authorized
|
|
||||||
* @param subscription
|
|
||||||
* the subscription they are attempting to change
|
|
||||||
* @return the response
|
|
||||||
* @throws VizException
|
|
||||||
*/
|
|
||||||
public IAuthorizedPermissionResponse checkPermissionToChangeSubscription(
|
|
||||||
final IUser user, String notAuthorizedMessage,
|
|
||||||
final Subscription subscription) throws VizException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check whether a user has the specified permissions.
|
* Check whether a user has the specified permissions.
|
||||||
*
|
*
|
||||||
|
@ -91,12 +73,12 @@ public interface IPermissionsService {
|
||||||
* @param permission
|
* @param permission
|
||||||
* the permission to check
|
* the permission to check
|
||||||
* @return IAuthorizedPermissionResponse the response
|
* @return IAuthorizedPermissionResponse the response
|
||||||
* @throws VizException
|
* @throws AuthException
|
||||||
* on error checking permissions
|
* on error checking permissions
|
||||||
*/
|
*/
|
||||||
public IAuthorizedPermissionResponse checkPermission(IUser user,
|
public IAuthorizedPermissionResponse checkPermission(IUser user,
|
||||||
String notAuthorizedMessage, DataDeliveryPermission permission)
|
String notAuthorizedMessage, String permission)
|
||||||
throws VizException;
|
throws AuthException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check whether a user has one of the specified permissions.
|
* Check whether a user has one of the specified permissions.
|
||||||
|
@ -109,10 +91,10 @@ public interface IPermissionsService {
|
||||||
* @param permissions
|
* @param permissions
|
||||||
* the permissions to check
|
* the permissions to check
|
||||||
* @return IAuthorizedPermissionResponse the response
|
* @return IAuthorizedPermissionResponse the response
|
||||||
* @throws VizException
|
* @throws AuthException
|
||||||
* on error checking permissions
|
* on error checking permissions
|
||||||
*/
|
*/
|
||||||
public IAuthorizedPermissionResponse checkPermissions(IUser user,
|
public IAuthorizedPermissionResponse checkPermissions(IUser user,
|
||||||
String notAuthorizedMessage, DataDeliveryPermission... permissions)
|
String notAuthorizedMessage, String... permissions)
|
||||||
throws VizException;
|
throws AuthException;
|
||||||
}
|
}
|
|
@ -19,6 +19,8 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.common.auth.user;
|
package com.raytheon.uf.common.auth.user;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A permission.
|
* A permission.
|
||||||
*
|
*
|
||||||
|
@ -28,7 +30,8 @@ package com.raytheon.uf.common.auth.user;
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Nov 5, 2012 1302 djohnson Initial creation
|
* Nov 05, 2012 1302 djohnson Initial creation
|
||||||
|
* Jul 26, 2031 2232 mpduff Refactored Data Delivery permissions.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -36,7 +39,7 @@ package com.raytheon.uf.common.auth.user;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public interface IPermission {
|
public interface IPermission extends ISerializableObject {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the description.
|
* Get the description.
|
||||||
|
@ -46,10 +49,9 @@ public interface IPermission {
|
||||||
String getDescription();
|
String getDescription();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The display name of the permission.
|
* Get the name.
|
||||||
*
|
*
|
||||||
* @return the name
|
* @return the name
|
||||||
*/
|
*/
|
||||||
@Override
|
String getName();
|
||||||
String toString();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,128 +0,0 @@
|
||||||
/**
|
|
||||||
* This software was developed and / or modified by Raytheon Company,
|
|
||||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
|
||||||
*
|
|
||||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
|
||||||
* This software product contains export-restricted data whose
|
|
||||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
|
||||||
* to non-U.S. persons whether in the United States or abroad requires
|
|
||||||
* an export license or other authorization.
|
|
||||||
*
|
|
||||||
* Contractor Name: Raytheon Company
|
|
||||||
* Contractor Address: 6825 Pine Street, Suite 340
|
|
||||||
* Mail Stop B8
|
|
||||||
* Omaha, NE 68106
|
|
||||||
* 402.291.0100
|
|
||||||
*
|
|
||||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
|
||||||
* further licensing information.
|
|
||||||
**/
|
|
||||||
package com.raytheon.uf.common.datadelivery.request;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermissionsContainer.DataDeliveryPermissionsContainerTypeAdapter;
|
|
||||||
import com.raytheon.uf.common.serialization.IDeserializationContext;
|
|
||||||
import com.raytheon.uf.common.serialization.ISerializationContext;
|
|
||||||
import com.raytheon.uf.common.serialization.ISerializationTypeAdapter;
|
|
||||||
import com.raytheon.uf.common.serialization.SerializationException;
|
|
||||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|
||||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeTypeAdapter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Used to hide direct access to permission collections in
|
|
||||||
* {@link DataDeliveryAuthRequest} from client-code.
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
*
|
|
||||||
* SOFTWARE HISTORY
|
|
||||||
*
|
|
||||||
* Date Ticket# Engineer Description
|
|
||||||
* ------------ ---------- ----------- --------------------------
|
|
||||||
* Oct 3, 2012 1241 djohnson Initial creation
|
|
||||||
*
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @author djohnson
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
@DynamicSerializeTypeAdapter(factory = DataDeliveryPermissionsContainerTypeAdapter.class)
|
|
||||||
public class DataDeliveryPermissionsContainer {
|
|
||||||
|
|
||||||
public static class DataDeliveryPermissionsContainerTypeAdapter implements
|
|
||||||
ISerializationTypeAdapter<DataDeliveryPermissionsContainer> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void serialize(ISerializationContext serializer,
|
|
||||||
DataDeliveryPermissionsContainer object)
|
|
||||||
throws SerializationException {
|
|
||||||
serializer.writeObject(object.authorizedList);
|
|
||||||
serializer.writeObject(object.requestList);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public DataDeliveryPermissionsContainer deserialize(
|
|
||||||
IDeserializationContext deserializer)
|
|
||||||
throws SerializationException {
|
|
||||||
DataDeliveryPermissionsContainer container = new DataDeliveryPermissionsContainer();
|
|
||||||
container.authorizedList
|
|
||||||
.addAll((List<DataDeliveryPermission>) deserializer
|
|
||||||
.readObject());
|
|
||||||
container.requestList
|
|
||||||
.addAll((List<DataDeliveryPermission>) deserializer
|
|
||||||
.readObject());
|
|
||||||
|
|
||||||
return container;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* List of permissions to check.
|
|
||||||
*/
|
|
||||||
@DynamicSerializeElement
|
|
||||||
private final List<DataDeliveryPermission> requestList = new ArrayList<DataDeliveryPermission>();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* List of permissions that were authorized.
|
|
||||||
*/
|
|
||||||
@DynamicSerializeElement
|
|
||||||
private final List<DataDeliveryPermission> authorizedList = new ArrayList<DataDeliveryPermission>();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param permission
|
|
||||||
*/
|
|
||||||
public void addRequestedPermission(DataDeliveryPermission permission) {
|
|
||||||
requestList.add(permission);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param permission
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public boolean contains(DataDeliveryPermission permission) {
|
|
||||||
return authorizedList.contains(permission);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param permission
|
|
||||||
*/
|
|
||||||
public void addAuthorized(DataDeliveryPermission permission) {
|
|
||||||
this.authorizedList.add(permission);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public List<DataDeliveryPermission> getRequestedPermissions() {
|
|
||||||
return requestList;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -17,17 +17,22 @@
|
||||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
* further licensing information.
|
* further licensing information.
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.common.datadelivery.request;
|
package com.raytheon.uf.common.plugin.nwsauth;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlElements;
|
||||||
|
|
||||||
import com.raytheon.uf.common.auth.req.AbstractPrivilegedRequest;
|
import com.raytheon.uf.common.auth.req.AbstractPrivilegedRequest;
|
||||||
|
import com.raytheon.uf.common.auth.req.IPermissionsService.IAuthorizedPermissionResponse;
|
||||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Authorization request for data delivery.
|
* Nws Authorization Request object.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -35,8 +40,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Apr 12, 2012 mpduff Initial creation
|
* Jul 26, 2013 2232 mpduff Initial creation
|
||||||
* Oct 03, 2012 1241 djohnson Use {@link DataDeliveryPermission}.
|
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -44,7 +48,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
@DynamicSerialize
|
@DynamicSerialize
|
||||||
public class DataDeliveryAuthRequest extends AbstractPrivilegedRequest implements ISerializableObject {
|
public class NwsAuthRequest extends AbstractPrivilegedRequest implements
|
||||||
|
ISerializableObject, IAuthorizedPermissionResponse {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Authorized flag, true if authorized.
|
* Authorized flag, true if authorized.
|
||||||
|
@ -58,20 +63,31 @@ public class DataDeliveryAuthRequest extends AbstractPrivilegedRequest implement
|
||||||
@DynamicSerializeElement
|
@DynamicSerializeElement
|
||||||
private String notAuthorizedMessage = "Not Authorized";
|
private String notAuthorizedMessage = "Not Authorized";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of requested permissions.
|
||||||
|
*/
|
||||||
@DynamicSerializeElement
|
@DynamicSerializeElement
|
||||||
private DataDeliveryPermissionsContainer permissionsContainer = new DataDeliveryPermissionsContainer();
|
@XmlElements({ @XmlElement(type = String.class) })
|
||||||
|
private List<String> requestList = new ArrayList<String>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of permissions that were authorized.
|
||||||
|
*/
|
||||||
|
@DynamicSerializeElement
|
||||||
|
@XmlElements({ @XmlElement(type = String.class) })
|
||||||
|
private List<String> authorizedList = new ArrayList<String>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
public DataDeliveryAuthRequest() {
|
public NwsAuthRequest() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the authorized
|
* @return the authorized
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isAuthorized() {
|
public boolean isAuthorized() {
|
||||||
return authorized;
|
return authorized;
|
||||||
}
|
}
|
||||||
|
@ -103,8 +119,8 @@ public class DataDeliveryAuthRequest extends AbstractPrivilegedRequest implement
|
||||||
* @param permission
|
* @param permission
|
||||||
* Authorized permission
|
* Authorized permission
|
||||||
*/
|
*/
|
||||||
public void addAuthorized(DataDeliveryPermission permission) {
|
public void addAuthorized(String permission) {
|
||||||
this.permissionsContainer.addAuthorized(permission);
|
this.authorizedList.add(permission);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -113,8 +129,8 @@ public class DataDeliveryAuthRequest extends AbstractPrivilegedRequest implement
|
||||||
*
|
*
|
||||||
* @param permission
|
* @param permission
|
||||||
*/
|
*/
|
||||||
public void addRequestedPermissions(DataDeliveryPermission permission) {
|
public void addRequestedPermissions(String permission) {
|
||||||
addRequestedPermissions(new DataDeliveryPermission[] { permission });
|
this.addRequestedPermissions(permission);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -122,11 +138,11 @@ public class DataDeliveryAuthRequest extends AbstractPrivilegedRequest implement
|
||||||
*
|
*
|
||||||
* @param permissions
|
* @param permissions
|
||||||
*/
|
*/
|
||||||
public void addRequestedPermissions(DataDeliveryPermission... permissions) {
|
public void addRequestedPermissions(String... permissions) {
|
||||||
for (DataDeliveryPermission permission : permissions) {
|
for (String permission : permissions) {
|
||||||
permissionsContainer.addRequestedPermission(permission);
|
this.requestList.add(permission);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check whether the authorizations allowed for this user contain a
|
* Check whether the authorizations allowed for this user contain a
|
||||||
|
@ -136,38 +152,52 @@ public class DataDeliveryAuthRequest extends AbstractPrivilegedRequest implement
|
||||||
* the permission to check for
|
* the permission to check for
|
||||||
* @return true if the authorized list contains the permission
|
* @return true if the authorized list contains the permission
|
||||||
*/
|
*/
|
||||||
public boolean isAuthorized(DataDeliveryPermission permission) {
|
public boolean isAuthorized(String permission) {
|
||||||
return permissionsContainer.contains(permission);
|
return this.authorizedList.contains(permission);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return the requestList
|
||||||
*/
|
*/
|
||||||
public List<DataDeliveryPermission> getRequestedPermissions() {
|
public List<String> getRequestedPermissions() {
|
||||||
return permissionsContainer.getRequestedPermissions();
|
return this.requestList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Added only to comply with dynamic serialization. DO NOT USE.
|
* @return the requestList
|
||||||
*
|
|
||||||
* @return the permissionsContainer
|
|
||||||
* @deprecated added only to comply with dynamic serialization
|
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
public List<String> getRequestList() {
|
||||||
public DataDeliveryPermissionsContainer getPermissionsContainer() {
|
return requestList;
|
||||||
return permissionsContainer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Added only to comply with dynamic serialization. DO NOT USE.
|
* @return the authorizedList
|
||||||
*
|
|
||||||
* @param permissionsContainer
|
|
||||||
* the permissionsContainer to set
|
|
||||||
* @deprecated added only to comply with dynamic serialization
|
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
public List<String> getAuthorizedList() {
|
||||||
public void setPermissionsContainer(
|
return authorizedList;
|
||||||
DataDeliveryPermissionsContainer permissionsContainer) {
|
}
|
||||||
this.permissionsContainer = permissionsContainer;
|
|
||||||
|
/**
|
||||||
|
* @param requestList
|
||||||
|
* the requestList to set
|
||||||
|
*/
|
||||||
|
public void setRequestList(List<String> requestList) {
|
||||||
|
this.requestList = requestList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param authorizedList
|
||||||
|
* the authorizedList to set
|
||||||
|
*/
|
||||||
|
public void setAuthorizedList(List<String> authorizedList) {
|
||||||
|
this.authorizedList = authorizedList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean hasPermission(String permission) {
|
||||||
|
return isAuthorized();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -30,7 +30,8 @@ import com.raytheon.uf.common.auth.user.IPermission;
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Nov 5, 2012 1302 djohnson Initial creation
|
* Nov 05, 2012 1302 djohnson Initial creation
|
||||||
|
* Jul 26, 2031 2232 mpduff Renamed toString to getName.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -40,8 +41,10 @@ import com.raytheon.uf.common.auth.user.IPermission;
|
||||||
|
|
||||||
public class NwsPermission implements IPermission {
|
public class NwsPermission implements IPermission {
|
||||||
|
|
||||||
|
/** Permission description */
|
||||||
private final String description;
|
private final String description;
|
||||||
|
|
||||||
|
/** Permission name */
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -61,9 +64,11 @@ public class NwsPermission implements IPermission {
|
||||||
return description;
|
return description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,4 +24,6 @@ Require-Bundle: com.raytheon.uf.common.auth;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.datadelivery.event;bundle-version="1.0.0",
|
com.raytheon.uf.common.datadelivery.event;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.common.datadelivery.service;bundle-version="1.0.0",
|
com.raytheon.uf.common.datadelivery.service;bundle-version="1.0.0",
|
||||||
org.springframework;bundle-version="2.5.6",
|
org.springframework;bundle-version="2.5.6",
|
||||||
com.raytheon.uf.edex.datadelivery.retrieval;bundle-version="1.0.0"
|
com.raytheon.uf.edex.datadelivery.retrieval;bundle-version="1.0.0",
|
||||||
|
com.raytheon.uf.edex.plugin.nwsauth;bundle-version="1.12.1174",
|
||||||
|
com.raytheon.uf.common.plugin.nwsauth;bundle-version="1.12.1174"
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
class="com.raytheon.uf.edex.datadelivery.service.services.DataDeliveryPrivilegedRequestHandler" />
|
class="com.raytheon.uf.edex.datadelivery.service.services.DataDeliveryPrivilegedRequestHandler" />
|
||||||
<bean factory-bean="handlerRegistry" factory-method="register">
|
<bean factory-bean="handlerRegistry" factory-method="register">
|
||||||
<constructor-arg
|
<constructor-arg
|
||||||
value="com.raytheon.uf.common.datadelivery.request.DataDeliveryAuthRequest" />
|
value="com.raytheon.uf.common.plugin.nwsauth.NwsAuthRequest" />
|
||||||
<constructor-arg ref="datadeliveryAuthorization" />
|
<constructor-arg ref="datadeliveryAuthorization" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,8 @@ package com.raytheon.uf.edex.datadelivery.service.services;
|
||||||
import com.raytheon.uf.common.auth.exception.AuthorizationException;
|
import com.raytheon.uf.common.auth.exception.AuthorizationException;
|
||||||
import com.raytheon.uf.common.auth.req.AbstractPrivilegedRequest;
|
import com.raytheon.uf.common.auth.req.AbstractPrivilegedRequest;
|
||||||
import com.raytheon.uf.common.auth.user.IUser;
|
import com.raytheon.uf.common.auth.user.IUser;
|
||||||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryAuthRequest;
|
|
||||||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
|
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
|
||||||
|
import com.raytheon.uf.common.plugin.nwsauth.NwsAuthRequest;
|
||||||
import com.raytheon.uf.edex.auth.AuthManager;
|
import com.raytheon.uf.edex.auth.AuthManager;
|
||||||
import com.raytheon.uf.edex.auth.AuthManagerFactory;
|
import com.raytheon.uf.edex.auth.AuthManagerFactory;
|
||||||
import com.raytheon.uf.edex.auth.req.AbstractPrivilegedRequestHandler;
|
import com.raytheon.uf.edex.auth.req.AbstractPrivilegedRequestHandler;
|
||||||
|
@ -39,8 +39,9 @@ import com.raytheon.uf.edex.auth.roles.IRoleStorage;
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Apr 12, 2012 224 mpduff Initial creation
|
* Apr 12, 2012 224 mpduff Initial creation
|
||||||
* Oct 03, 2012 1241 djohnson Use {@link DataDeliveryPermission}.
|
* Oct 03, 2012 1241 djohnson Use {@link DataDeliveryPermission}.
|
||||||
|
* Jul 26, 2031 2232 mpduff Refactored Data Delivery permissions.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -48,8 +49,8 @@ import com.raytheon.uf.edex.auth.roles.IRoleStorage;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class DataDeliveryPrivilegedRequestHandler<T extends AbstractPrivilegedRequest> extends
|
public class DataDeliveryPrivilegedRequestHandler<T extends AbstractPrivilegedRequest>
|
||||||
AbstractPrivilegedRequestHandler<T> {
|
extends AbstractPrivilegedRequestHandler<T> {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -62,33 +63,32 @@ public class DataDeliveryPrivilegedRequestHandler<T extends AbstractPrivilegedRe
|
||||||
@Override
|
@Override
|
||||||
public AuthorizationResponse authorized(IUser user, T request)
|
public AuthorizationResponse authorized(IUser user, T request)
|
||||||
throws AuthorizationException {
|
throws AuthorizationException {
|
||||||
if (request instanceof DataDeliveryAuthRequest) {
|
if (request instanceof NwsAuthRequest) {
|
||||||
DataDeliveryAuthRequest dataDeliveryRequest = (DataDeliveryAuthRequest) request;
|
NwsAuthRequest authRequest = (NwsAuthRequest) request;
|
||||||
|
|
||||||
AuthManager manager = AuthManagerFactory.getInstance().getManager();
|
AuthManager manager = AuthManagerFactory.getInstance().getManager();
|
||||||
IRoleStorage roles = manager.getRoleStorage();
|
IRoleStorage roles = manager.getRoleStorage();
|
||||||
|
|
||||||
boolean addedAuthorization = false;
|
boolean addedAuthorization = false;
|
||||||
|
|
||||||
for (DataDeliveryPermission permission : dataDeliveryRequest
|
for (String permission : authRequest.getRequestedPermissions()) {
|
||||||
.getRequestedPermissions()) {
|
boolean authorized = roles.isAuthorized(permission.toString(),
|
||||||
boolean authorized = roles.isAuthorized(permission.toString(), user
|
user.uniqueId().toString(), "Data Delivery");
|
||||||
.uniqueId().toString(),
|
|
||||||
"Data Delivery");
|
|
||||||
addedAuthorization |= authorized;
|
addedAuthorization |= authorized;
|
||||||
|
|
||||||
if (authorized) {
|
if (authorized) {
|
||||||
dataDeliveryRequest.addAuthorized(permission);
|
authRequest.addAuthorized(permission);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (addedAuthorization) {
|
if (addedAuthorization) {
|
||||||
return new AuthorizationResponse(true);
|
return new AuthorizationResponse(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new AuthorizationResponse(dataDeliveryRequest.getNotAuthorizedMessage());
|
return new AuthorizationResponse(
|
||||||
|
authRequest.getNotAuthorizedMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
return new AuthorizationResponse(false);
|
return new AuthorizationResponse(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,13 +101,16 @@ public class DataDeliveryPrivilegedRequestHandler<T extends AbstractPrivilegedRe
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object handleRequest(T request) throws Exception {
|
public Object handleRequest(T request) throws Exception {
|
||||||
// We are only looking for authorized or not and don't have any work to do here
|
/*
|
||||||
// If we get here then we are authorized, set true in request object and return it
|
* We are only looking for authorized or not and don't have any work to
|
||||||
if (request instanceof DataDeliveryAuthRequest) {
|
* do here. If we get here then we are authorized, set true in request
|
||||||
DataDeliveryAuthRequest r = (DataDeliveryAuthRequest) request;
|
* object and return it
|
||||||
|
*/
|
||||||
|
if (request instanceof NwsAuthRequest) {
|
||||||
|
NwsAuthRequest r = (NwsAuthRequest) request;
|
||||||
r.setAuthorized(true);
|
r.setAuthorized(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return request;
|
return request;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,8 @@ import com.raytheon.uf.edex.auth.RemoteRequestRouteWrapper;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* 5/3/2013 1948 bphillip Initial implementation
|
* 5/3/2013 1948 bphillip Initial implementation
|
||||||
|
* 7/26/2031 2232 mpduff Don't override executeThrift.
|
||||||
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author bphillip
|
* @author bphillip
|
||||||
|
@ -48,11 +50,6 @@ public class RegistryRemoteRequestWrapper extends RemoteRequestRouteWrapper
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] request(byte[] data) {
|
public byte[] request(byte[] data) {
|
||||||
return executeThrift(data);
|
return executeThrift(new ByteArrayInputStream(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] executeThrift(byte[] data) {
|
|
||||||
return super.executeThrift(new ByteArrayInputStream(data));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ import org.junit.Before;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.auth.req.IPermissionsService;
|
||||||
import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthService;
|
import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthService;
|
||||||
import com.raytheon.uf.common.datadelivery.bandwidth.IProposeScheduleResponse;
|
import com.raytheon.uf.common.datadelivery.bandwidth.IProposeScheduleResponse;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.AdhocSubscription;
|
import com.raytheon.uf.common.datadelivery.registry.AdhocSubscription;
|
||||||
|
@ -77,6 +78,7 @@ import com.raytheon.uf.viz.datadelivery.subscription.SubscriptionService.IForceA
|
||||||
* Nov 20, 2012 1286 djohnson Rewrite to support proposing subscription stores/updates and force applying.
|
* Nov 20, 2012 1286 djohnson Rewrite to support proposing subscription stores/updates and force applying.
|
||||||
* Jan 02, 2012 1345 djohnson Fix broken tests from using VizApp to move work off the UI thread.
|
* Jan 02, 2012 1345 djohnson Fix broken tests from using VizApp to move work off the UI thread.
|
||||||
* May 08, 2000 2013 djohnson Allow checks for duplicate subscriptions.
|
* May 08, 2000 2013 djohnson Allow checks for duplicate subscriptions.
|
||||||
|
* Jul 26, 2031 2232 mpduff Refactored Data Delivery permissions.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -112,7 +114,7 @@ public abstract class AbstractSubscriptionServiceTest {
|
||||||
|
|
||||||
final IBandwidthService mockBandwidthService = mock(IBandwidthService.class);
|
final IBandwidthService mockBandwidthService = mock(IBandwidthService.class);
|
||||||
|
|
||||||
final IPermissionsService permissionsService = mock(IPermissionsService.class);
|
final IPermissionsService permissionsService = mock(RequestFromServerPermissionsService.class);
|
||||||
|
|
||||||
final ISubscriptionOverlapService subscriptionOverlapService = mock(ISubscriptionOverlapService.class);
|
final ISubscriptionOverlapService subscriptionOverlapService = mock(ISubscriptionOverlapService.class);
|
||||||
|
|
||||||
|
@ -351,6 +353,7 @@ public abstract class AbstractSubscriptionServiceTest {
|
||||||
throws RegistryHandlerException {
|
throws RegistryHandlerException {
|
||||||
// Not valid for adhocs
|
// Not valid for adhocs
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verifies that the only interactions with the subscription handler are to
|
* Verifies that the only interactions with the subscription handler are to
|
||||||
* check for duplicate/overlapping subscriptions.
|
* check for duplicate/overlapping subscriptions.
|
||||||
|
@ -506,4 +509,3 @@ public abstract class AbstractSubscriptionServiceTest {
|
||||||
*/
|
*/
|
||||||
abstract ForceApplyPromptConfiguration getExpectedForceApplyPromptConfiguration();
|
abstract ForceApplyPromptConfiguration getExpectedForceApplyPromptConfiguration();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,18 +35,18 @@ import java.util.Collections;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.auth.AuthException;
|
||||||
|
import com.raytheon.uf.common.auth.req.IPermissionsService.IAuthorizedPermissionResponse;
|
||||||
import com.raytheon.uf.common.auth.user.IUser;
|
import com.raytheon.uf.common.auth.user.IUser;
|
||||||
import com.raytheon.uf.common.datadelivery.bandwidth.IProposeScheduleResponse;
|
import com.raytheon.uf.common.datadelivery.bandwidth.IProposeScheduleResponse;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.InitialPendingSiteSubscription;
|
import com.raytheon.uf.common.datadelivery.registry.InitialPendingSiteSubscription;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers;
|
import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionHandler;
|
import com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionHandler;
|
||||||
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
|
|
||||||
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
||||||
import com.raytheon.uf.common.registry.handler.RegistryObjectHandlersUtil;
|
import com.raytheon.uf.common.registry.handler.RegistryObjectHandlersUtil;
|
||||||
import com.raytheon.uf.common.util.CollectionUtil;
|
import com.raytheon.uf.common.util.CollectionUtil;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.datadelivery.subscription.IPermissionsService.IAuthorizedPermissionResponse;
|
|
||||||
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionService.ISubscriptionServiceResult;
|
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionService.ISubscriptionServiceResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -61,6 +61,7 @@ import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionService.ISubsc
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Nov 21, 2012 1286 djohnson Initial creation
|
* Nov 21, 2012 1286 djohnson Initial creation
|
||||||
* May 08, 2000 2013 djohnson Allow checks for duplicate subscriptions.
|
* May 08, 2000 2013 djohnson Allow checks for duplicate subscriptions.
|
||||||
|
* Jul 26, 2031 2232 mpduff Refactored Data Delivery permissions.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -73,7 +74,7 @@ public class SubscriptionServiceMassUpdateTest extends
|
||||||
private final IAuthorizedPermissionResponse authorizedPermissionsResponse = mock(IAuthorizedPermissionResponse.class);
|
private final IAuthorizedPermissionResponse authorizedPermissionsResponse = mock(IAuthorizedPermissionResponse.class);
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUpPermissionsResponse() throws VizException {
|
public void setUpPermissionsResponse() throws VizException, AuthException {
|
||||||
userHasAllPermissions();
|
userHasAllPermissions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +146,7 @@ public class SubscriptionServiceMassUpdateTest extends
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUpdateWithPendingCheckNotifiesOfPendingSubscriptionsCreated()
|
public void testUpdateWithPendingCheckNotifiesOfPendingSubscriptionsCreated()
|
||||||
throws RegistryHandlerException, VizException {
|
throws RegistryHandlerException, VizException, AuthException {
|
||||||
RegistryObjectHandlersUtil.initMocks();
|
RegistryObjectHandlersUtil.initMocks();
|
||||||
|
|
||||||
returnZeroSubscriptionNamesWhenProposeScheduleCalled();
|
returnZeroSubscriptionNamesWhenProposeScheduleCalled();
|
||||||
|
@ -182,12 +183,13 @@ public class SubscriptionServiceMassUpdateTest extends
|
||||||
* @param subscription
|
* @param subscription
|
||||||
* the subscription
|
* the subscription
|
||||||
* @throws VizException
|
* @throws VizException
|
||||||
|
* @throws AuthException
|
||||||
*/
|
*/
|
||||||
private void subscriptionCantBeChangedByUser(Subscription subscription)
|
private void subscriptionCantBeChangedByUser(Subscription subscription)
|
||||||
throws VizException {
|
throws VizException, AuthException {
|
||||||
IAuthorizedPermissionResponse noPermission = mock(IAuthorizedPermissionResponse.class);
|
IAuthorizedPermissionResponse noPermission = mock(IAuthorizedPermissionResponse.class);
|
||||||
when(
|
when(
|
||||||
permissionsService
|
((RequestFromServerPermissionsService) permissionsService)
|
||||||
.checkPermissionToChangeSubscription(any(IUser.class),
|
.checkPermissionToChangeSubscription(any(IUser.class),
|
||||||
any(String.class), same(subscription)))
|
any(String.class), same(subscription)))
|
||||||
.thenReturn(noPermission);
|
.thenReturn(noPermission);
|
||||||
|
@ -313,18 +315,19 @@ public class SubscriptionServiceMassUpdateTest extends
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void userHasAllPermissions() throws VizException {
|
private void userHasAllPermissions() throws VizException, AuthException {
|
||||||
when(
|
when(
|
||||||
permissionsService.checkPermission(any(IUser.class),
|
permissionsService.checkPermission(any(IUser.class),
|
||||||
anyString(), any(DataDeliveryPermission.class)))
|
anyString(), any(String.class))).thenReturn(
|
||||||
.thenReturn(authorizedPermissionsResponse);
|
authorizedPermissionsResponse);
|
||||||
when(
|
when(
|
||||||
permissionsService.checkPermissions(any(IUser.class),
|
permissionsService.checkPermissions(any(IUser.class),
|
||||||
anyString(), any(DataDeliveryPermission.class)))
|
anyString(), any(String.class))).thenReturn(
|
||||||
.thenReturn(authorizedPermissionsResponse);
|
authorizedPermissionsResponse);
|
||||||
when(
|
when(
|
||||||
permissionsService.checkPermissionToChangeSubscription(
|
((RequestFromServerPermissionsService) permissionsService)
|
||||||
any(IUser.class), anyString(), any(Subscription.class)))
|
.checkPermissionToChangeSubscription(any(IUser.class),
|
||||||
|
anyString(), any(Subscription.class)))
|
||||||
.thenReturn(authorizedPermissionsResponse);
|
.thenReturn(authorizedPermissionsResponse);
|
||||||
when(authorizedPermissionsResponse.isAuthorized()).thenReturn(true);
|
when(authorizedPermissionsResponse.isAuthorized()).thenReturn(true);
|
||||||
}
|
}
|
||||||
|
@ -352,8 +355,7 @@ public class SubscriptionServiceMassUpdateTest extends
|
||||||
getExpectedForceApplyMessage(),
|
getExpectedForceApplyMessage(),
|
||||||
IProposeScheduleResponse.VALUE_NOT_SET,
|
IProposeScheduleResponse.VALUE_NOT_SET,
|
||||||
IProposeScheduleResponse.VALUE_NOT_SET,
|
IProposeScheduleResponse.VALUE_NOT_SET,
|
||||||
IProposeScheduleResponse.VALUE_NOT_SET,
|
IProposeScheduleResponse.VALUE_NOT_SET, mockPromptDisplayText,
|
||||||
mockPromptDisplayText,
|
|
||||||
getExpectedDisplayForceApplyPromptSubscription(),
|
getExpectedDisplayForceApplyPromptSubscription(),
|
||||||
subNameResults);
|
subNameResults);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue