Class RoleName

All Implemented Interfaces:
PermissionArgumentFormat.IPermissionComponent, PermissionArgumentFormat.IRoleNameRestriction

A role name. Accepts only uppercase letters and single underscores between letters.
  • Method Details

    • isValidRoleName

      public static boolean isValidRoleName(String theRoleName)
      Validates that a role name contains only uppercase letters and single underscores between letters.

      Valid examples: MDM_UI_DATA_STEWARD, MY_ROLE, A

      Invalid examples: myRole (lowercase), ROLE__SALES (consecutive underscores), _ADMIN (leading underscore), ADMIN_ (trailing underscore), ROLE123 (numbers), ROLE-ADMIN (special characters)

      Parameters:
      theRoleName - the role name to validate
      Returns:
      true if the role name is valid, false otherwise
    • validateRoleName

      public static void validateRoleName(String theRoleName, String theRoleType)
      Validates that a role name contains only uppercase letters and single underscores between letters. Throws an exception if the role name is invalid.
      Parameters:
      theRoleName - the role name to validate
      theRoleType - the type of role (e.g., "APP_ROLE", "CUSTOM_ROLE") for error messages
      Throws:
      IllegalArgumentException - if the role name is invalid
    • getRoleName

      public String getRoleName()
      Description copied from interface: PermissionArgumentFormat.IRoleNameRestriction
      the name of a role
      Specified by:
      getRoleName in interface PermissionArgumentFormat.IRoleNameRestriction