Manage users and groups in P4 Server

To create P4 DAM users, see Create users.

To perform these tasks on the P4 Server side, see the following topics in the P4 Server Administration Documentation:

In P4 Server, do not alter or edit groups with a name following any of these conventions in any way:

HTH-//<depot-path>/<repo-path>-<HTH_ACCESS_LEVEL>

HTH-<depot-name>-<hth_access_level>

HTH-<company-administrator>

Mapping TeamHub roles to graph depot permissions

In P4 Server, you grant permissions to users or groups. In TeamHub, you assign roles. The following table indicates how each TeamHub role is mapped to specific graph depot permissions in P4 Server.

TeamHub Role Graph Depot Permission

Administrator

admin

Manager

write-all

Master

force-push

delete-repo

create-repo

Developer

delete-ref

create-ref

write-all

Guest

read

For more information on P4 Server permissions, see the p4 grant-permission command in the P4 CLI Reference.

For more information on TeamHub roles, see the Roles chapter in the Perforce TeamHub Documentation.

Enable synchronization of P4 users in P4 DAM

To automatically give all P4 Server users access to P4 DAM, select the check box. To do this, either:

  • In the TeamHub admin UI, go to Preferences > Helix Core Server > Account and group synchronization.

  • In the /var/opt/hth/shared/hth.json configuration file, change the setting.

When the Enable synchronization of Helix users in Helix DAM check box is selected:

  • You cannot give non-P4 users access to P4 DAM.

  • You cannot create or deactivate a user manually.

If you do not have enough P4 DAM licenses for all your P4 Server users, or if you want to exclude users and groups from accessing P4 DAM, see Including and excluding P4 Server users and groups.

A P4 DAM license is allocated to the p4search-user. To exclude the p4search-user from taking a license, see Including and excluding P4 Server users and groups.

Including and excluding P4 Server users and groups

You may want to include users or groups, or one or more users in a group, that exist in P4 Server to be available in P4 DAM, or exclude them from being displayed. This is possible by configuring the respective keys. To do this, either:

  • In the TeamHub admin UI, go to Preferences > Helix Core Server > Account and group synchronization.

  • In the /var/opt/hth/shared/hth.json configuration file, change the setting.

For details on these keys, see Section: helix in TeamHub configuration.

Note:

  • TeamHub bots are created as users on the P4 Server.
  • The include/exclude configuration applies to bots in the same way as it does for other users.
  • Add the users to the appropriate groups before updating the include/exclude configuration.

  • Update the include/exclude configuration before managing users, bots, and groups in the TeamHub admin UI.

When synchronizing users, TeamHub proceeds in the following order. TeamHub:

  1. Includes direct users and bots
  2. Adds users and bots from groups
  3. Excludes users and bots from groups
  4. Excludes direct users and bots

When synchronizing groups, TeamHub first includes groups and then extracts any groups that are marked as excluded in the configuration.

To include or exclude P4 Server users or groups:

  1. In the Preferences view, under Account and group synchronization, enter the name of users or groups as needed.

    For example:

    To include the users called user1 and user2, enter the following in the Include users field: ^(user1|user2)$

    To include users from a group called perforce-group, enter the following in the Include users from groups field: ^perforce-group$

    For details and more examples, see Section: helix.

  2. Click Save preferences.

    A warning appears because the changes have not been applied to the TeamHub server yet. Perform the following step to finalize the configuration.

  3. To apply server configuration changes to the TeamHub server, connect to the server via SSH and run the following command:

    sudo hth-ctl reconfigure

  4. After successfully running the reconfigure command, reload the TeamHub admin UI.

    Failure to run the hth-ctl reconfigure command may result in normal web server interruption messages, such as the HTTP Error 503. The service is unavailable. error, because the services come back online.

JSON configuration examples

This section includes examples of how to exclude groups and users by editing the "helix" key in the /var/opt/hth/shared/hth.json file. Excluding groups and users works exactly the same way, so you can apply the following examples to all cases.

To exclude all groups starting with external- or test- or ending with test:

^(external-|test-).*, test$

To exclude user1 and user2, and any user starting or ending with test:

^(user1|user2)$, test$, ^test

Following is a code snippet from the hth.json file with these values included under the "helix" key:

"users_include_regex": "",
"users_exclude_regex": "^(user1|user2)$, test$, ^test",
"users_from_groups_include_regex": "",
"users_from_groups_exclude_regex": "",
"groups_include_regex": "",
"groups_exclude_regex": "^(external-|test-).*, test$"