mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

neil_a_wilson
09.51.2007 ed39262fa647434d4a0e31f07754a263ce2b16e3
opends/src/server/org/opends/server/backends/SchemaBackend.java
@@ -57,6 +57,7 @@
import org.opends.server.api.AlertGenerator;
import org.opends.server.api.Backend;
import org.opends.server.api.ClientConnection;
import org.opends.server.api.ConfigurableComponent;
import org.opends.server.api.MatchingRule;
import org.opends.server.config.BooleanConfigAttribute;
@@ -103,6 +104,7 @@
import org.opends.server.types.NameForm;
import org.opends.server.types.ObjectClass;
import org.opends.server.types.ObjectClassType;
import org.opends.server.types.Privilege;
import org.opends.server.types.RDN;
import org.opends.server.types.RestoreConfig;
import org.opends.server.types.ResultCode;
@@ -950,6 +952,20 @@
                      String.valueOf(modifyOperation));
    // Make sure that the authenticated user has the necessary UPDATE_SCHEMA
    // privilege.
    ClientConnection clientConnection = modifyOperation.getClientConnection();
    if (! clientConnection.hasPrivilege(Privilege.UPDATE_SCHEMA,
                                        modifyOperation))
    {
      int    msgID   = MSGID_SCHEMA_MODIFY_INSUFFICIENT_PRIVILEGES;
      String message = getMessage(msgID);
      throw new DirectoryException(ResultCode.INSUFFICIENT_ACCESS_RIGHTS,
                                   message, msgID);
    }
    // At present, we only allow the addition of new attribute types,
    // object classes, name forms, DIT content rules, DIT structure rules, and
    // matching rule uses.  We will not support removing or replacing existing