Create or edit Perforce user specifications and preferences.
By default, any system user becomes a valid Perforce user the first time they use any Perforce command. When Perforce is first used, a Perforce user specification with default settings is created for the invoking user. The p4 user command can be used to edit these settings, or to create the user record if the user has not used Perforce before.
Perforce superusers can prevent random users from accessing Perforce with p4 protect.
When p4 user is called, a form is brought up in the editor defined by the P4EDITOR environment or registry variable. Perforce expects the form's entries to be entered in Perforce's standard forms format.
When called without a username, p4 user will edit the specification of the current user. When called with a username, the user specification will be displayed, but can't be changed. Superusers can edit other users specifications with the -f superuser flag: p4 user -f username.
The user who gives the Perforce command is not necessarily the user that the command runs under. The user for any particular command is determined by the following:
-d username | Deletes the specified user. |
-f | Superuser flag; allows the superuser to modify or delete the specified user. |
-i | Read the user specification from standard input. The input must conform to the forms format. |
-o | Write the user specification to standard output. |
g_opts | See global options. |
Can File Arg Use Revision Specifier? |
Can File Arg Use Revision Range? |
Minimal Access Level Required |
---|---|---|
N/A | N/A | list |
The -d flag may be used by non-superusers only to delete the user specification that the command runs as. Perforce superusers can delete any Perforce user.
User deletion will fail if the specified user owns any branches, labels, clients, jobs, or open files. Delete these objects first (submitting or reverting open files), and then delete the user.
By default, user records are created without passwords, and any Perforce user can impersonate another by setting P4USER or by using the globally-available -u flag. To prevent another user from impersonating you, set the value of the Password: field to any string that doesn't contain whitespace or the comment character #. Once a password has been set, it must be provided to each p4 command; this can be done in one of three ways:
No matter what the length of the Password: field's value, it will be displayed as six asterisks whenever you subsequently call p4 user.
The collected values of the Email: fields can be listed for each user with the p4 users command, and can used for any purpose.
The Perforce change review daemon uses the values in this field: when activated, it will send email to users whenever files they've subscribed to in the Reviews: field have changed. Files listed in this field must be specified in depot syntax; for example, if user joe has a Reviews: field value of
//depot/foo/...then the change review daemon will send joe email whenever any README file has been submitted, and whenever any file under //depot/foo has changed.