]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/AddPrivileges.java
Add the ability to remove a JCR privilege from a given node
[lgpl/argeo-commons.git] / org.argeo.eclipse.ui.workbench / src / org / argeo / eclipse / ui / workbench / commands / AddPrivileges.java
index 49ed4378f8ca5959bdceb9bd060ac8ba7595c422..cc7d94ee602f2d31f5d2aa6eb8d6f8e33b1a5406 100644 (file)
@@ -22,9 +22,9 @@ import org.argeo.ArgeoException;
 import org.argeo.eclipse.ui.TreeParent;
 import org.argeo.eclipse.ui.dialogs.ErrorFeedback;
 import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
-import org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem;
-import org.argeo.eclipse.ui.workbench.jcr.internal.model.WorkspaceElem;
-import org.argeo.eclipse.ui.workbench.jcr.internal.parts.ChangeRightsWizard;
+import org.argeo.eclipse.ui.workbench.internal.jcr.model.SingleJcrNodeElem;
+import org.argeo.eclipse.ui.workbench.internal.jcr.model.WorkspaceElem;
+import org.argeo.eclipse.ui.workbench.internal.jcr.parts.AddPrivilegeWizard;
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
@@ -61,17 +61,17 @@ public class AddPrivileges extends AbstractHandler {
                                return null;
 
                        try {
-                               ChangeRightsWizard wizard = new ChangeRightsWizard(
-                                               jcrParentNode.getSession(), jcrParentNode.getPath(),
-                                               userAdmin);
+                               String targetPath = jcrParentNode.getPath();
+                               AddPrivilegeWizard wizard = new AddPrivilegeWizard(
+                                               jcrParentNode.getSession(), targetPath, userAdmin);
                                WizardDialog dialog = new WizardDialog(
                                                HandlerUtil.getActiveShell(event), wizard);
                                dialog.open();
                                return null;
                        } catch (RepositoryException re) {
-                               throw new ArgeoException(
-                                               "Unexpected error while creating the new workspace.",
-                                               re);
+                               throw new ArgeoException("Unable to retrieve "
+                                               + "path or JCR session to add privilege on "
+                                               + jcrParentNode, re);
                        }
                } else {
                        ErrorFeedback.show("Cannot add privileges");