RepositoryGetUser Method (String, Options)
|
Get the record for an existing user from the repository.
Namespace:
Perforce.P4
Assembly:
p4api.net (in p4api.net.dll) Version: 2024.1.261.8274
Syntaxpublic User GetUser(
string user,
Options options
)
Public Function GetUser (
user As String,
options As Options
) As User
public:
User^ GetUser(
String^ user,
Options^ options
)
member GetUser :
user : string *
options : Options -> User
Parameters
- user
- Type: SystemString
User name - options
- Type: Perforce.P4Options
There are no valid flags to use when fetching an existing user
Return Value
Type:
UserThe User object if new user was found, null if creation failed
Remarks The '-i' flag is added if not specified by the caller
p4 help user
user -- Create or edit a user specification
p4 user [-f] [name]
p4 user -d [-f] name
p4 user -o [name]
p4 user -i [-f]
Create a new user specification or edit an existing user specification.
The specification form is put into a temporary file and the editor
(configured by the environment variable $P4EDITOR) is invoked.
Normally, a user specification is created automatically the first
time that the user issues any command that updates the depot. The
'p4 user' command is typically used to edit the user's subscription
list for change review.
The user specification form contains the following fields:
User: The user name (read-only).
Email: The user's email address (Default: user@client).
Update: The date the specification was last modified (read-only).
Access: The date that the user last issued a client command.
FullName: The user's real name.
JobView: Selects jobs that are displayed when the user creates
a changelist. These jobs can be closed automatically
when the user submits the changelist. For a description
of jobview syntax, see 'p4 help jobview'
Reviews: The subscription list for change review. There is no
limit on the number of lines that this field can contain.
You can include the following wildcards:
... matches any characters including /
* matches any character except /
Password: The user's password. See 'p4 help passwd'.
Type: Must be 'service', operator, or 'standard'. Default is
'standard'. Once set, the user type cannot be changed.
AuthMethod: Must be 'perforce' or 'ldap'. Default is 'perforce'
Unless overridden by the 'auth.default.method'
configurable, see 'p4 help configurables'. AuthMethod
can only be changed when the -f flag has been provided.
The -d flag deletes the specified user (unless the user has files
open).
The -o flag writes the user specification to the standard output.
The user's editor is not invoked.
The -i flag reads a user specification from the standard input.
The user's editor is not invoked.
The -f flag forces the creation, update or deletion of the specified
user, and enables you to change the Last Modified date. By default,
users can only delete or modify their own user specifications. The
-f flag requires 'super' access, which is granted by 'p4 protect'.
Examples
To get a user's specification for a user with the username bsmith:
User u = Repository.GetUser("bsmith", null);
See Also