projects
/
gpl
/
argeo-suite.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Introduce user and session nodes.
[gpl/argeo-suite.git]
/
org.argeo.suite.core
/
src
/
org
/
argeo
/
suite
/
core
/
SuiteMaintenanceService.java
diff --git
a/org.argeo.suite.core/src/org/argeo/suite/core/SuiteMaintenanceService.java
b/org.argeo.suite.core/src/org/argeo/suite/core/SuiteMaintenanceService.java
index 44d218c4764d89ec1c935993e5c2abc4059c2152..db6ac913422a5118db5428dbef8fa0b6966ef5bd 100644
(file)
--- a/
org.argeo.suite.core/src/org/argeo/suite/core/SuiteMaintenanceService.java
+++ b/
org.argeo.suite.core/src/org/argeo/suite/core/SuiteMaintenanceService.java
@@
-5,9
+5,12
@@
import java.io.IOException;
import javax.jcr.Node;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.Node;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.security.Privilege;
-import org.argeo.
entity.EntityName
s;
+import org.argeo.
api.NodeConstant
s;
import org.argeo.entity.EntityType;
import org.argeo.entity.EntityType;
+import org.argeo.jcr.JcrUtils;
import org.argeo.maintenance.AbstractMaintenanceService;
/** Initialises an Argeo Suite backend. */
import org.argeo.maintenance.AbstractMaintenanceService;
/** Initialises an Argeo Suite backend. */
@@
-17,8
+20,8
@@
public class SuiteMaintenanceService extends AbstractMaintenanceService {
public boolean prepareJcrTree(Session adminSession) throws RepositoryException, IOException {
boolean modified = false;
Node rootNode = adminSession.getRootNode();
public boolean prepareJcrTree(Session adminSession) throws RepositoryException, IOException {
boolean modified = false;
Node rootNode = adminSession.getRootNode();
- if (!rootNode.hasNode(Entity
Names.TERM_BASE
)) {
- rootNode.addNode(Entity
Names.TERM_BASE, EntityType.typologies.get()
);
+ if (!rootNode.hasNode(Entity
Type.user.name()
)) {
+ rootNode.addNode(Entity
Type.user.name(), NodeType.NT_UNSTRUCTURED
);
modified = true;
}
if (modified)
modified = true;
}
if (modified)
@@
-26,4
+29,10
@@
public class SuiteMaintenanceService extends AbstractMaintenanceService {
return modified;
}
return modified;
}
+ @Override
+ public void configurePrivileges(Session adminSession) throws RepositoryException {
+ JcrUtils.addPrivilege(adminSession, EntityType.user.basePath(), NodeConstants.ROLE_USER_ADMIN,
+ Privilege.JCR_ALL);
+ }
+
}
}