Package perforce :: Package async :: Module objects :: Class User
[frames] | no frames]

Class User



        object --+    
                 |    
objects.FormObject --+
                     |
                    User

A Perforce user object.

Instance Methods
 
__init__(self, connection, userName, form)
Initialises the User based on the form retrieved on the connection.
 
save(self, force=False)
Save any changes made to the user to the Perforce server.
 
delete(self, force=False)
Delete this user from the Perforce server.
 
setPassword(self, newPassword, oldPassword=None)
Set a new password for this user.

Inherited from objects.FormObject: __delitem__, __getitem__, __iter__, __setitem__

Inherited from object: __delattr__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Static Methods
User
__new__(cls, connection, userName)
Creates a User based on the form retrieved on the connection.
Properties

Inherited from object: __class__

Method Details

__new__(cls, connection, userName)
Static Method

 
Creates a User based on the form retrieved on the connection.
Parameters:
  • connection (perforce.connection.Connection) - The connection to the Perforce server to use.
  • userName (str or unicode) - The name of the user to query.
Returns: User
A deferred that fires with the User object once its form has been retrieved.
Raises:
  • CommandError - If there was a Perforce error querying the user.
Overrides: object.__new__

__init__(self, connection, userName, form)
(Constructor)

 
Initialises the User based on the form retrieved on the connection.
Parameters:
Overrides: objects.FormObject.__init__

save(self, force=False)

 

Save any changes made to the user to the Perforce server.

By default a user can only update their own user specification. Specifying the force parameter as True allows users with 'super' access to modify other user's specifications and to modify the 'Update' field.
Parameters:
  • force (boolean) - Flag indicating whether the update is forced.
Returns:
A deferred that fires when the operation completes.
Raises:
  • CommandError - If the operation failed due to Perforce errors.

delete(self, force=False)

 

Delete this user from the Perforce server.

By default a user can only delete their own user specification. Specifying the force parameter as True allows users with 'super' access to delete other users.
Parameters:
  • force (boolean) - Flag indicating whether to force deletion of the user.
Returns:
A deferred that fires when the operation completes.
Raises:
  • CommandError - If the operation failed due to Perforce errors.

setPassword(self, newPassword, oldPassword=None)

 

Set a new password for this user.

By default a user can only change their own password, and then only if they correctly provide their old password. However, users with 'super' access can set new passwords for other users without providing the old password.
Parameters:
  • newPassword (str, unicode or None) - The new password to set. Pass None or '' for the new password to set it to blank.
  • oldPassword (str, unicode or None) - The old password. Leave as None to set someone else's password without the old password (provided you have 'super' access).
Returns:
A deferred that fires when the operation completes.
Raises:
  • CommandError - If the operation failed due to Perforce errors.