You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2007/01/30 19:15:42 UTC

svn commit: r501498 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java

Author: elecharny
Date: Tue Jan 30 10:15:41 2007
New Revision: 501498

URL: http://svn.apache.org/viewvc?view=rev&rev=501498
Log:
Added a fix for DIRSERVER-835

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java?view=diff&rev=501498&r1=501497&r2=501498
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java Tue Jan 30 10:15:41 2007
@@ -30,6 +30,7 @@
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
+import javax.naming.NoPermissionException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.DirContext;
@@ -1341,6 +1342,15 @@
                 throw new LdapInvalidAttributeIdentifierException();
             }
 
+            // We will forbid modification of operationnal attributes which are not
+            // user modifiable.
+            AttributeType attributeType = atRegistry.lookup( change.getID() );
+            
+            if ( !attributeType.isCanUserModify() )
+            {
+                throw new NoPermissionException( "Cannot modify the attribute '" + change.getID() + "'" );
+            }
+            
             switch ( modOp )
             {
                 case DirContext.ADD_ATTRIBUTE :