directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r307044 - in /directory/apacheds/trunk/core/src: main/java/org/apache/ldap/server/authz/ main/java/org/apache/ldap/server/jndi/ test/org/apache/ldap/server/subtree/
Date Fri, 07 Oct 2005 07:48:46 GMT
Author: akarasulu
Date: Fri Oct  7 00:48:36 2005
New Revision: 307044

URL: http://svn.apache.org/viewcvs?rev=307044&view=rev
Log:
added new group for managing administrators

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/AuthorizationService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/DefaultContextFactoryService.java
    directory/apacheds/trunk/core/src/test/org/apache/ldap/server/subtree/SubentryServiceTest.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/AuthorizationService.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/AuthorizationService.java?rev=307044&r1=307043&r2=307044&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/AuthorizationService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/authz/AuthorizationService.java
Fri Oct  7 00:48:36 2005
@@ -550,4 +550,10 @@
 
         return super.compare(next, name, oid, value);
     }
+
+
+    public void cacheNewGroup( String upName, Name normName, Attributes entry ) throws NamingException
+    {
+        this.groupCache.groupAdded( upName, normName, entry );
+    }
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/DefaultContextFactoryService.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/DefaultContextFactoryService.java?rev=307044&r1=307043&r2=307044&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/DefaultContextFactoryService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/DefaultContextFactoryService.java
Fri Oct  7 00:48:36 2005
@@ -47,6 +47,7 @@
 import org.apache.ldap.server.schema.GlobalRegistries;
 import org.apache.ldap.server.schema.bootstrap.BootstrapRegistries;
 import org.apache.ldap.server.schema.bootstrap.BootstrapSchemaLoader;
+import org.apache.ldap.server.authz.AuthorizationService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -450,6 +451,32 @@
             attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );
 
             partitionNexus.add( "ou=groups,ou=system", new LdapName( "ou=groups,ou=system"
), attributes );
+        }
+
+        // -------------------------------------------------------------------
+        // create administrator group
+        // -------------------------------------------------------------------
+
+        String upName = "cn=Administrators,ou=groups,ou=system";
+        Name normName = new LdapName( upName );
+        if ( !partitionNexus.hasEntry( normName ) )
+        {
+            firstStart = true;
+            checkPermissionToCreateBootstrapEntries();
+
+            Attributes attributes = new LockableAttributesImpl();
+            Attribute objectClass = new LockableAttributeImpl( "objectClass" );
+            objectClass.add( "top" );
+            objectClass.add( "groupOfUniqueNames" );
+            attributes.put( objectClass );
+            attributes.put( "cn", "Administrators" );
+            attributes.put( "uniqueMember", ContextPartitionNexus.ADMIN_PRINCIPAL );
+            attributes.put( "creatorsName", ContextPartitionNexus.ADMIN_PRINCIPAL );
+            attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );
+
+            partitionNexus.add( upName, normName, attributes );
+            AuthorizationService authzSrvc = ( AuthorizationService ) interceptorChain.get(
"authorizationService" );
+            authzSrvc.cacheNewGroup( upName, normName, attributes );
         }
 
         // -------------------------------------------------------------------

Modified: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/subtree/SubentryServiceTest.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/subtree/SubentryServiceTest.java?rev=307044&r1=307043&r2=307044&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/org/apache/ldap/server/subtree/SubentryServiceTest.java
(original)
+++ directory/apacheds/trunk/core/src/test/org/apache/ldap/server/subtree/SubentryServiceTest.java
Fri Oct  7 00:48:36 2005
@@ -452,8 +452,6 @@
         super.sysRoot.createSubcontext( "cn=testsubentry", getTestSubentry() );
         super.sysRoot.destroySubcontext( "cn=testsubentry" );
 
-        // for the hell of it destroy regular entry
-        super.sysRoot.destroySubcontext( "ou=groups" );
         Map results = getAllEntries();
 
         // --------------------------------------------------------------------



Mime
View raw message