@ Nonnull public EChange renameUserGroup ( @ Nullable final String sUserGroupID , @ Nonnull @ Nonempty final String sNewName ) { // Resolve user group final UserGroup aUserGroup = getOfID ( sUserGroupID ) ; if ( aUserGroup == null ) { AuditHelper . onAuditModifyFailure ( UserGroup . OT , sUserGroupID , "no-such-usergroup-id" , "name" ) ; return EChange . UNCHANGED ; } m_aRWLock . writeLock ( ) . lock ( ) ; try { if ( aUserGroup . setName ( sNewName ) . isUnchanged ( ) ) return EChange . UNCHANGED ; BusinessObjectHelper . setLastModificationNow ( aUserGroup ) ; internalUpdateItem ( aUserGroup ) ; } finally { m_aRWLock . writeLock ( ) . unlock ( ) ; } AuditHelper . onAuditModifySuccess ( UserGroup . OT , "name" , sUserGroupID , sNewName ) ; // Execute callback as the very last action m_aCallbacks . forEach ( aCB -> aCB . onUserGroupRenamed ( aUserGroup ) ) ; return EChange . CHANGED ; }
Rename the user group with the specified ID