Component description

The codetable-label-user component creates a user object relation (relation between the object and a user). For example, it allows the assignment of owners and stewards to objects.

Example

Minimal JSON

{
    "type": "codetable-label-user",
    "values": [
        {
            "title": "",
            "userRelationTypeKey": ""
        }
    ]
}
{
    "type": "codetable-label-user",
    "values": [
        {
            "userRelationTypeKey": "recipe_owner",
            "title": "title.recipeOwner"
        },
        {
            "userRelationTypeKey": "best_cook",
            "title": "title.bestCook"
        }
    ]
}

Example taken from the Writing an Application Package tutorial.

Nested properties

PropertyDescriptionValuesMandatory
typecodetable-label-userstringYes
valuesArray of values defining what user relation types the component establishes between the selected user(s) and the object.arrayYes
componentIdUnique ID of a component. If left empty, a random string will be generated. Primarily used in patch packages to define the component’s position within the layout (template).stringNo
titleTranslation key of the title. Define the key in translations to specify how the text is displayed in the UI. Unlike the name property, if you use a specific string of text for the title, this text will appear with the package key. For example, Comment Section will be displayed as package_key_comment section.stringNo
settingsComponent settings. Supports valueVisibility, which hides single user relation rows by role or user group.jsonNo

Nested properties in values

PropertyDescriptionValuesMandatory
userRelationTypeKeyKey of the assigned user relation type.stringYes
isConditionalWhen enabled, limits the users and groups offered for this relation to members of the relations listed in basedOnUserRelationTypeKeys.booleanNo
basedOnUserRelationTypeKeysKeys of the user relation types on the same object whose members, including inherited users and groups, are offered for this relation. Mandatory when isConditional is true. Ensure it references user relation types that exist on the object type, or package installation fails. Combines members from multiple keys into one deduplicated list.array of stringNo
titleTranslation key of the title. Define the key in translations to specify how the text is displayed in the UI. Unlike the name property, if you use a specific string of text for the title, this text will appear with the package key. For example, Comment Section will be displayed as package_key_comment section.stringNo

Value visibility

The valueVisibility setting hides single user relation rows from users outside the listed roles or groups. It is a map keyed by the userRelationTypeKey of the row. Each entry has two optional properties:

PropertyDescriptionValues
visibleToRolesRoles that can see the value: ADMIN, CONTRIBUTOR, VIEWER, GUEST. The ROLE_ prefix and any letter case are also accepted.array of strings
visibleToGroupsNames of the user groups whose members can see the value (case-insensitive, surrounding spaces ignored). Never use group IDs.array of strings
  • Roles and groups work as a union. Administrators always see every value.
  • Each key is the resolved key of the value: the user relation type key as stored, with no # or pkg# prefix (core#description becomes core_description). Matching ignores letter case.
  • A key that matches no value in the component, including one written in reference form such as #core_account_id, is ignored. The worker logs a warning.
  • If every role in an entry is unknown, the value becomes visible to administrators only.
  • Group membership is checked when the object page loads. A membership change applies on the user’s next page load.
Warning

Visibility is a view customization, not access control. It applies to the object page only (read view, inline edit, fullscreen editor, and panel description). Hidden values stay available through the API, API tables and bulk edit, search, Excel and Word export, and the create dialog.

Example:

{
  "type": "codetable-label-user",
  "values": [{ "userRelationTypeKey": "core_hr_owner" }],
  "settings": {
    "valueVisibility": {
      "core_hr_owner": { "visibleToGroups": ["HR"] }
    }
  }
}