Skip to content

Commit

Permalink
Partial fix to DIRSERVER_1728: interceptor-normalization &
Browse files Browse the repository at this point in the history
interceptor-operational
  • Loading branch information
elecharny committed Aug 21, 2024
1 parent 3663272 commit cdc4fdb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
8 changes: 5 additions & 3 deletions i18n/src/main/java/org/apache/directory/server/i18n/I18n.java
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,15 @@ public enum I18n
// No error

// apacheds-interceptors-normalization errors 23000 - 23999
ERR_23000_FAILED_TO_EXPAND_NODE("ERR_23000_FAILED_TO_EXPAND_NODE"),

// apacheds-interceptors-number errors 24000 - 24999
// No error

// apacheds-interceptors-operational errors 25000 - 25999
ERR_25000_CANNOT_MODIFY_OPERATIONAL_ATTRIBUTE("ERR_25000_CANNOT_MODIFY_OPERATIONAL_ATTRIBUTE"),
ERR_25001_CANNOT_MODIFY__MODIFIERS_NAME("ERR_25001_CANNOT_MODIFY__MODIFIERS_NAME"),

// apacheds-interceptors-ppolicy errors 26000 - 26999
// No error

Expand Down Expand Up @@ -518,8 +523,6 @@ public enum I18n

ERR_1("ERR_1"),
ERR_7("ERR_7"),
ERR_30("ERR_30"),
ERR_31("ERR_31"),
ERR_32("ERR_32"),
ERR_36("ERR_36"),
ERR_37("ERR_37"),
Expand Down Expand Up @@ -626,7 +629,6 @@ public enum I18n
ERR_249("ERR_249"),
ERR_254_ADD_EXISTING_VALUE("ERR_254_ADD_EXISTING_VALUE"),
ERR_259("ERR_259"),
ERR_261("ERR_261"),
ERR_262("ERR_262"),
ERR_269("ERR_269"),
ERR_270("ERR_270"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,15 @@ ERR_19004_CANNOT_ALLOW_SUBSCHEMA_SUBENTRY_MOVE=Can not allow the move of the sub
# --- no error ---

# apacheds-interceptors-normalization errors 23000 - 23999
ERR_23000_FAILED_TO_EXPAND_NODE=Failed to expand node

# apacheds-interceptors-number errors 24000 - 24999
# --- no error ---

# apacheds-interceptors-operational errors 25000 - 25999
ERR_25000_CANNOT_MODIFY_OPERATIONAL_ATTRIBUTE=The {0} operational attribute cannot be modified by a user
ERR_25001_CANNOT_MODIFY__MODIFIERS_NAME=The ModifiersName operational attribute cannot be modified by a user

# apacheds-interceptors-ppolicy errors 26000 - 26999
# --- no error ---

Expand Down Expand Up @@ -508,8 +513,6 @@ ERR_49045_SCOPE_NODE_NOT_IN_SUBTREE_SCOPE=ScopeNode is not of subtree scope.

ERR_1=Failed to identify OID for: {0}
ERR_7=Cannot create a digested password for algorithm ''{0}''
ERR_30=The {0} operational attribute cannot be modified by a user
ERR_31=The ModifiersName operational attribute cannot be modified by a user
ERR_32=The ModifyTimestamp operational attribute cannot be modified by a user
ERR_36=An LDAPURL should not contains a scope
ERR_37=An LDAPURL should not contains filters
Expand Down Expand Up @@ -641,7 +644,6 @@ ERR_226=[33] aliasProblem - the alias when dereferenced would not name a known o
ERR_249=The global schema subentry cannot be added since it exists by default.
ERR_254_ADD_EXISTING_VALUE=Trying to add existing value ''{0}'' to attribute {1}
ERR_259=Attempt to search under non-existant entry\:
ERR_261=Failed to expand node
ERR_262=System partition has wrong name: should be ''system'' not ''{0}''.
ERR_269=userRoot() in org.apache.directory.server.prefs.ServerPreferencesFactory not implemented!
ERR_270=Failed to set up node.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ else if ( leaf instanceof SubstringNode )
}
catch ( LdapException e )
{
// log something here and throw a runtime excpetion
throw new RuntimeException( I18n.err( I18n.ERR_261 ) );
// log something here and throw a runtime exception
throw new RuntimeException( I18n.err( I18n.ERR_23000_FAILED_TO_EXPAND_NODE ) );
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ private boolean checkAddOperationalAttribute( boolean isAdmin, Entry entry, Attr
if ( !isAdmin )
{
// Wrong !
String message = I18n.err( I18n.ERR_30, attribute );
String message = I18n.err( I18n.ERR_25000_CANNOT_MODIFY_OPERATIONAL_ATTRIBUTE, attribute );
LOG.error( message );
throw new LdapNoPermissionException( message );
}
Expand Down Expand Up @@ -383,7 +383,7 @@ public void modify( ModifyOperationContext modifyContext ) throws LdapException
{
if ( !isAdmin )
{
String message = I18n.err( I18n.ERR_31 );
String message = I18n.err( I18n.ERR_25001_CANNOT_MODIFY__MODIFIERS_NAME );
LOG.error( message );
throw new LdapNoPermissionException( message );
}
Expand All @@ -397,7 +397,7 @@ public void modify( ModifyOperationContext modifyContext ) throws LdapException
{
if ( !isAdmin )
{
String message = I18n.err( I18n.ERR_30, attributeType );
String message = I18n.err( I18n.ERR_25000_CANNOT_MODIFY_OPERATIONAL_ATTRIBUTE, attributeType );
LOG.error( message );
throw new LdapNoPermissionException( message );
}
Expand All @@ -411,7 +411,7 @@ public void modify( ModifyOperationContext modifyContext ) throws LdapException
{
if ( !isAdmin )
{
String message = I18n.err( I18n.ERR_30, attributeType );
String message = I18n.err( I18n.ERR_25000_CANNOT_MODIFY_OPERATIONAL_ATTRIBUTE, attributeType );
LOG.error( message );
throw new LdapNoPermissionException( message );
}
Expand All @@ -423,7 +423,7 @@ public void modify( ModifyOperationContext modifyContext ) throws LdapException

if ( PWD_POLICY_STATE_ATTRIBUTE_TYPES.contains( attributeType ) && !isAdmin )
{
String message = I18n.err( I18n.ERR_30, attributeType );
String message = I18n.err( I18n.ERR_25000_CANNOT_MODIFY_OPERATIONAL_ATTRIBUTE, attributeType );
LOG.error( message );
throw new LdapNoPermissionException( message );
}
Expand Down

0 comments on commit cdc4fdb

Please sign in to comment.