]> git.argeo.org Git - gpl/argeo-slc.git/blob - plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/wizards/ChangeRightsWizard.java
Improve job progress bar
[gpl/argeo-slc.git] / plugins / org.argeo.slc.client.ui.dist / src / main / java / org / argeo / slc / client / ui / dist / wizards / ChangeRightsWizard.java
1 package org.argeo.slc.client.ui.dist.wizards;
2
3 import javax.jcr.RepositoryException;
4 import javax.jcr.Session;
5
6 import org.argeo.ArgeoException;
7 import org.argeo.jcr.JcrUtils;
8 import org.eclipse.jface.wizard.Wizard;
9
10 /**
11 * Small wizard to manage authorizations on the root node of the current
12 * workspace
13 */
14 public class ChangeRightsWizard extends Wizard {
15
16 private Session currentSession;
17
18 // This page widget
19 private ChooseRightsPage page;
20
21 public ChangeRightsWizard(Session currentSession) {
22 super();
23 this.currentSession = currentSession;
24 }
25
26 @Override
27 public void addPages() {
28 try {
29 page = new ChooseRightsPage();
30 addPage(page);
31 } catch (Exception e) {
32 throw new ArgeoException("Cannot add page to wizard ", e);
33 }
34 }
35
36 @Override
37 public boolean performFinish() {
38 if (!canFinish())
39 return false;
40 try {
41 JcrUtils.addPrivilege(currentSession, "/", page.getGroupName(),
42 page.getAuthTypeStr());
43 } catch (RepositoryException re) {
44 throw new ArgeoException(
45 "Unexpected error while setting privileges", re);
46 }
47 return true;
48 }
49 }