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