diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2014-09-18 11:45:11 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2014-09-18 11:45:11 +0200 |
| commit | 540488a65ab5a805be663d0be2d96865a8e8938a (patch) | |
| tree | 8fc09b87fafaf8cf9cc7db24bfe1bb4d790abae2 | |
| parent | d2660e10d972e236dabd26560950400e4e02bf32 (diff) | |
Support hierarchical roles. Fixes #199
| -rw-r--r-- | src/main/java/com/c2kernel/lookup/ldap/LDAPLookup.java | 7 | ||||
| -rw-r--r-- | src/main/resources/LDAPboot.txt | 3 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/main/java/com/c2kernel/lookup/ldap/LDAPLookup.java b/src/main/java/com/c2kernel/lookup/ldap/LDAPLookup.java index 96ab609..0d3cbd4 100644 --- a/src/main/java/com/c2kernel/lookup/ldap/LDAPLookup.java +++ b/src/main/java/com/c2kernel/lookup/ldap/LDAPLookup.java @@ -432,7 +432,7 @@ public class LDAPLookup implements LookupManager{ }
else if (LDAPLookupUtils.existsAttributeValue(entry,"objectclass","cristalrole"))
{ //cristalrole
- thisPath = new RolePath(LDAPDN.explodeDN(dn,true)[0],
+ thisPath = new RolePath(getPathComponents(dn.substring(0, dn.lastIndexOf(mDomainTypeRoot))),
LDAPLookupUtils.getFirstAttributeValue(entry, "jobList").equals("TRUE"));
}
else if (LDAPLookupUtils.existsAttributeValue(entry,"objectclass","aliasObject") ||
@@ -496,7 +496,6 @@ public class LDAPLookup implements LookupManager{ @Override
public Iterator<Path> getChildren(Path path) {
- if (path instanceof RolePath) return ((RolePath)path).getChildren();
String filter = "objectclass=*";
LDAPSearchConstraints searchCons = new LDAPSearchConstraints();
searchCons.setBatchSize(10);
@@ -561,16 +560,14 @@ public class LDAPLookup implements LookupManager{ }
- //NOTE: A role must have at LEAST 1 userDN, cannot be empty...
//Creates a cristalRole
//CristalRole is-a specialized CristalContext which contains multi-valued uniqueMember attribute pointing to cristalagents
@Override
- public RolePath createRole(String roleName, boolean jobList)
+ public RolePath createRole(RolePath rolePath)
throws ObjectAlreadyExistsException, ObjectCannotBeUpdated
{
// create the role
- RolePath rolePath = new RolePath(roleName, jobList);
String roleDN = getFullDN(rolePath);
LDAPEntry roleNode;
try
diff --git a/src/main/resources/LDAPboot.txt b/src/main/resources/LDAPboot.txt index da74bfd..23ac0ef 100644 --- a/src/main/resources/LDAPboot.txt +++ b/src/main/resources/LDAPboot.txt @@ -1,3 +1,2 @@ cn=entity,
-cn=domain,
-cn=agent,cn=domain,
\ No newline at end of file +cn=domain,
\ No newline at end of file |
