projects
/
gpl
/
argeo-suite.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8119a84
)
Undeprecate user node methods
author
Mathieu <mbaudier@argeo.org>
Mon, 14 Nov 2022 05:31:07 +0000
(06:31 +0100)
committer
Mathieu <mbaudier@argeo.org>
Mon, 14 Nov 2022 05:31:07 +0000
(06:31 +0100)
org.argeo.app.core/src/org/argeo/app/core/SuiteUtils.java
patch
|
blob
|
history
diff --git
a/org.argeo.app.core/src/org/argeo/app/core/SuiteUtils.java
b/org.argeo.app.core/src/org/argeo/app/core/SuiteUtils.java
index da794cb0cd424aa74412a3b9a3d00102833d6bb3..ad4e2ac5e6caf3c7e9e5f90d8c5b2ef546e4b469 100644
(file)
--- a/
org.argeo.app.core/src/org/argeo/app/core/SuiteUtils.java
+++ b/
org.argeo.app.core/src/org/argeo/app/core/SuiteUtils.java
@@
-1,7
+1,6
@@
package org.argeo.app.core;
import java.util.HashSet;
package org.argeo.app.core;
import java.util.HashSet;
-import java.util.Optional;
import java.util.Set;
import javax.jcr.Node;
import java.util.Set;
import javax.jcr.Node;
@@
-24,13
+23,11
@@
import org.argeo.jcr.JcrUtils;
/** Utilities around the Argeo Suite APIs. */
public class SuiteUtils {
/** Utilities around the Argeo Suite APIs. */
public class SuiteUtils {
- @Deprecated
public static String getUserNodePath(String userDn) {
String uid = RoleNameUtils.getLastRdnValue(userDn);
return EntityType.user.basePath() + '/' + uid;
}
public static String getUserNodePath(String userDn) {
String uid = RoleNameUtils.getLastRdnValue(userDn);
return EntityType.user.basePath() + '/' + uid;
}
- @Deprecated
private static Node getOrCreateUserNode(Session adminSession, String userDn) {
try {
Node usersBase = adminSession.getNode(EntityType.user.basePath());
private static Node getOrCreateUserNode(Session adminSession, String userDn) {
try {
Node usersBase = adminSession.getNode(EntityType.user.basePath());
@@
-40,8
+37,8
@@
public class SuiteUtils {
userNode = usersBase.addNode(uid, NodeType.NT_UNSTRUCTURED);
userNode.addMixin(EntityType.user.get());
userNode.addMixin(NodeType.MIX_CREATED);
userNode = usersBase.addNode(uid, NodeType.NT_UNSTRUCTURED);
userNode.addMixin(EntityType.user.get());
userNode.addMixin(NodeType.MIX_CREATED);
- userNode.setProperty(LdapAttr.distinguishedName.
property
(), userDn.toString());
- userNode.setProperty(LdapAttr.uid.
property
(), uid);
+ userNode.setProperty(LdapAttr.distinguishedName.
get
(), userDn.toString());
+ userNode.setProperty(LdapAttr.uid.
get
(), uid);
adminSession.save();
// JackrabbitSecurityUtils.denyPrivilege(adminSession, userNode.getPath(), SuiteRole.coworker.dn(),
// Privilege.JCR_READ);
adminSession.save();
// JackrabbitSecurityUtils.denyPrivilege(adminSession, userNode.getPath(), SuiteRole.coworker.dn(),
// Privilege.JCR_READ);
@@
-58,7
+55,6
@@
public class SuiteUtils {
}
}
}
}
- @Deprecated
public static Node getCmsSessionNode(Session session, CmsSession cmsSession) {
try {
return session.getNode(getUserNodePath(cmsSession.getUserDn()) + '/' + cmsSession.getUuid().toString());
public static Node getCmsSessionNode(Session session, CmsSession cmsSession) {
try {
return session.getNode(getUserNodePath(cmsSession.getUserDn()) + '/' + cmsSession.getUuid().toString());
@@
-67,7
+63,6
@@
public class SuiteUtils {
}
}
}
}
- @Deprecated
public static Node getOrCreateCmsSessionNode(Session adminSession, CmsSession cmsSession) {
try {
String userDn = cmsSession.getUserDn();
public static Node getOrCreateCmsSessionNode(Session adminSession, CmsSession cmsSession) {
try {
String userDn = cmsSession.getUserDn();
@@
-121,9
+116,9
@@
public class SuiteUtils {
}
synchronized static public long findNextId(Content hierarchyUnit, QName cclass) {
}
synchronized static public long findNextId(Content hierarchyUnit, QName cclass) {
- if (!hierarchyUnit.hasContentClass(LdapObj.posixGroup.qName()))
+ if (!hierarchyUnit.hasContentClass(LdapObj.posixGroup.qName()))
throw new IllegalArgumentException(hierarchyUnit + " is not a POSIX group");
throw new IllegalArgumentException(hierarchyUnit + " is not a POSIX group");
-
+
long min = hierarchyUnit.get(LdapAttr.gidNumber.qName(), Long.class).orElseThrow();
long currentMax = 0l;
for (Content childHu : hierarchyUnit) {
long min = hierarchyUnit.get(LdapAttr.gidNumber.qName(), Long.class).orElseThrow();
long currentMax = 0l;
for (Content childHu : hierarchyUnit) {