Class UserTypeDuplicateEvent


public class UserTypeDuplicateEvent extends SimpleBusinessEvent<BOUserTypeDuplicate,BOUserTypeDuplicate>
Business event for duplicating user types.

This event encapsulates the request to duplicate an existing user type, creating a new user type with the same permissions and authentication policies as the original. The event takes a BOUserTypeDuplicate object as input, which contains both the new user type properties (code and description) and the ID of the original user type to copy permissions and policies from.

Input: BOUserTypeDuplicate containing:

  • boUserType - The new user type with desired code and description
  • originalUserTypeId - The ID of the user type to copy permissions and policies from

Output: BOUserTypeDuplicate containing the newly created user type and the original user type ID.

Processing: This event is processed by BTUserTypeDuplicate, which performs the following operations:

  1. Creates a new user type with the provided properties
  2. Copies all permission grants from the original user type
  3. Copies the authentication policy from the original user type
  4. Invalidates the user types cache

Required Permission: foundation.base.usertype.edit

Usage Example:


 BOUserType newUserType = new BOUserType();
 newUserType.setCode("NEW_ADMIN");
 newUserType.setDescription(new LocalizedString().add(Lang.DEVELOP_LANG, "New Administrator"));

 BOUserTypeDuplicate input = new BOUserTypeDuplicate();
 input.setBoUserType(newUserType);
 input.setOriginalUserTypeId(123L); // ID of the user type to copy from

 UserTypeDuplicateEvent event = new UserTypeDuplicateEvent(input);
 BOUserTypeDuplicate result = event.launch();
 
Since:
12.0
See Also:
  • Constructor Details

    • UserTypeDuplicateEvent

      public UserTypeDuplicateEvent(BOUserTypeDuplicate input)
      Creates a new user type duplication event.

      The input object must contain both the new user type properties (code and description) and the ID of the original user type to copy permissions and authentication policies from.

      Parameters:
      input - the BOUserTypeDuplicate object containing the new user type and the original user type ID to duplicate from