Authorizing Git users

To authorize Git users to perform transactions with Git Fusion, you use the p4 protect table, Git Fusion repo-specific and global permission groups, and the default group p4 key.

For more information, see How do user permissions work?

To set up authorization:

Assign Helix Core permissions to Git Fusion users

Run p4 protect to verify or add write permissions for all Helix Core users associated with the Git users who will push changes to the Git Fusion repos.

To successfully perform a push, the Git pusher's Helix Core user must have write permissions to the affected files. The Git author must also have write permissions, unless you use the unknown_git user, the ignore_author_permissions property, or the change-owner property to circumvent that requirement (for more information, see Enable pushes when Git authors lack Helix Core permissions.

Note

As of the first 2014.1 patch, you can also configure a branch to be read-only, regardless of a user's Helix Core permissions. See Repo configuration file: key definitions and samples.

Git Fusion does not check the p4 protect table for pull transactions, unless you enable the global p4gf_config property to require a read-access check for all pull transactions (see Enforce Helix Core read permissions on Git pull). If you do not enable this option, you do not need to assign permissions in the p4 protect table for users who are only performing pulls.

Create the permission groups and group p4 key

  1. Run the User and Client Initialization script (p4gf_init.py).

    The global groups and the default permission p4 key are automatically generated by the User and Client Initialization script ( p4gf_init.py). By default, the group owner is set as git-fusion-user. Do not change the owner.

    You can run this script any time after Git Fusion has been initialized in your Perforce service with the Super User Initialization script ( p4gf_super_init.py). If p4gf_init.py has not been run, p4gf_init_repo.py will invoke it automatically. If neither has been run, the first push or clone against this Git Fusion server will invoke them both automatically.

    Important

    The default setting for the git-fusion-permission-group-default p4 key is push. Change this setting to none or pull, using p4 key, if you want to prevent authenticated users who are not members of a permission group from having push access to all Git Fusion repos by default. Note that 0 (zero) has the same effect as setting it to push.

    If you set the p4 key to none, you must run p4gf_init_repo.py.

  2. Run the Repo Initialization script ( p4gf_init_repo.py) for each repo.

    p4gf_init_repo.py repo_name

    This script creates the Git Fusion push and pull permission groups for each repo you run it for. By default, the group owner is set as git-fusion-user. Do not change the owner.

    You can run this script any time after Git Fusion has been initialized in your Perforce service with the Super User Initialization script ( p4gf_super_init.py). If p4gf_init.py has not been run, p4gf_init_repo.py will invoke it automatically. If neither has been run, the first push or clone against this Git Fusion server will invoke them both automatically.

    For more information about the p4gf_init_repo.py script and options, see Setting up Repos.

Populate the permission groups and set the group default p4 key

The way you use the Helix Core permission groups and the group default p4 key depends on your needs.

Important

By default, pull requests only check the p4 protects table to confirm that the git-fusion-user has access to the Helix Core depot location; the Git puller's read access to the Helix Core location is not checked unless you have enabled the global p4gf_config property to require a read-access check for all pull transactions (see Enforce Helix Core read permissions on Git pull). Therefore, if you have not enabled this option, you must do one of the following to prevent authenticated Git Fusion users from pulling from a particular Helix Core depot location, :

The following are some options:

Git Fusion creates global groups git-fusion-pull and git-fusion-push as part of its configuration script, configure-git-fusion.sh. It creates repo groups git-fusion-repo_name-pull and git-fusion-repo_name-push during the first push or pull for that repo.

For more information about setting group permissions and p4 keys in Helix Core, see Helix Versioning Engine Administrator Guide: Fundamentals.

Enable pushes when Git authors lack Helix Core permissions

The Git pusher is not always the same Git user as the author and committer of the changes being pushed. While the pusher must always be a licensed Helix Core user with write permission for the depot locations being pushed to, you may not need all of your Git authors to be mapped to a licensed Helix Core user. Git Fusion provides the following tools to enable pushes when the Git author is not a Perforce user:

For more information about repo configuration files, see Setting up Repos

Enforce Helix Core read permissions on Git pull

By default, Git Fusion checks Helix Core permissions only for Git push transactions, relying on user authentication to the Git Fusion server and membership in git-fusion-pull permission groups to control Git pull (read) access to Git Fusion repos. However, if you want to enforce the permissions that you have set up in the Helix Coreprotects table on all Git pull transactions as well, you can do so by setting the read-permission-check property in the global p4gf_config file. See Global configuration file: keys and default values