directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r501498 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
Date Tue, 30 Jan 2007 18:15:42 GMT
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 :



Mime
View raw message