p4 grant-permission (graph)
Assign the specified permission for the specified depot of type
graph
(or a repo in that depot) to the specified user or
group.
For depots of type graph
only.
Syntax
p4 [g-opts] grant-permission -d graphDepot1 -g group [-r ref] -p permission
p4 [g-opts] grant-permission -d graphDepot1 -u user [-r ref] -p permission
p4 [g-opts] grant-permission -n //graphDepot1/reponame -g group [-r ref] -p permission
p4 [g-opts] grant-permission -n //graphDepot1/reponame -u user [-r ref] -p permission
p4 [g-opts] grant-permission -n //graphDepot1/reponame -g group -r ref -p restricted-ref
p4 [g-opts] grant-permission -n //graphDepot1/reponame -u user -r ref -p restricted-ref
Description
An administrator is the owner, or a user that has been granted the
admin
permission for that specific graph depot or
repo.
The user who creates a depot is the owner
of that depot and
always has full admin
rights to the depot. An
admin
user can grant permissions, including the
admin
permission, to groups and users of the depot or a repo
it contains.
This command does not verify the existence of the specified user or group. Nor does this command verify the existence of the specified reference to a branch or tag. Therefore, you can use those options before or after creating the user, group, or reference to a branch or tag.
Permissions are additive. For example, you can give a user the
create-repo
permission, and later also give that user the
delete-repo
permission. After you have granted a permission,
you can remove that permission with p4
revoke-permission
.
Certain permissions imply multiple permissions. Any such permissions are included automatically and cannot be revoked unless the permission that contains them is revoked. See Permissions.
Options
|
Applies to the depot and its repos. Note
The Helix Server superuser can specify |
|
Applies to the repo with the specified name. |
|
Applies to the specified group. |
|
Applies to the specified user. |
|
Optional for the Required for the |
|
Applies the specified permission. |
|
See Global options. |
Permissions
When you grant a permission to a user or group, that user or group receives:
- the specified permission
- any permissions that are implied (implicitly included) with the explicit permission
The implied permissions associated with each assigned permission:
Assigned Permission |
Implied Permission | ||||||||
---|---|---|---|---|---|---|---|---|---|
admin | force-push | delete-ref | create-ref | delete-repo | create-repo | write-all | write-ref | read | |
admin | |||||||||
force-push | |||||||||
delete-ref | |||||||||
create-ref | |||||||||
delete-repo | |||||||||
create-repo | |||||||||
write-all | |||||||||
write-ref | |||||||||
read |
The capability associated with each permission:
|
Grant and revoke permissions for the repo or depot specified. |
|
Force an overwrite to the branch. |
|
Delete the repository’s branch or tag specified by
|
|
Create and set the initial value of |
|
Delete a repo in the specified depot of type
|
|
Allows a user to create a new repo on the graph depot through
the |
|
Read and update files and references of the branch or tag
specified by |
|
Read and update the repository’s branch or tag specified by
|
|
Read the files in the specified depot or repo. This allows the user to clone and pull from the repo. |
The following permission is exclusive and has no implied permissions:
restricted-ref
|
The specified user or group can update the ref, (branch or tag)
specified by the |
Examples
To assign the read
permission for the specified depot of
type graph
(and its repos) to the specified user:
p4 grant-permission -p read -d graphDepot1 -u bruno
To limit the assignment to a specific repo within a specific graph depot:
p4 grant-permission -n //graphDepot1/repo8 -u bruno -p read
To limit a reference-related assignment (write-ref
,
write-all
, create-ref
, delete-ref
,
force-push
) to a specific branch or tag:
p4 grant-permission -n //graphDepot1/repo8 -r "refs/heads/rel-2.1.14" -u bruno -p create-ref
To make the reference-related assignment apply to more than one branch or tag, use the asterisk (*) wildcard:
p4 grant-permission -n //graphDepot1/repo8 -r "refs/heads/rel-*" -u bruno -p delete-ref
To restrict a particular branch to a specified user or group, such as to restrict the master branch to the devops team:
p4 grant-permission -n //repo/test -g devops -p restricted-ref -r refs/heads/master
Related Commands
To list the permissions currently granted |
|
To remove a permission |