RT::User(3)

NAME
  RT::User - RT User object

SYNOPSIS
  use RT::User;

DESCRIPTION

METHODS

  Load
Load a user object from the database. Takes a single argument. If the argument is numerical, load by the column 'id'. Otherwise, load by the "Name" column which is the user's textual username.

  LoadByEmail
Tries to load this user object from the database by the user's email address.

  ValidateEmailAddress ADDRESS
Returns true if the email address entered is not in use by another user or is undef or ''. Returns false if it's in use.

  SetRandomPassword
Takes no arguments. Returns a status code and a new password or an error message. If the status is 1, the second value returned is the new password. If the status is anything else, the new value returned is the error code.

  ResetPassword
Returns status, [ERROR or new password]. Resets this user\'s password to a randomly generated pronouncable password and emails them, using a global template called "RT_PasswordChange", which can be overridden with global templates "RT_PasswordChange_Privileged" or "RT_PasswordChange_NonPrivileged" for privileged and Non-privileged users respectively.

  GenerateRandomPassword MIN_LEN and MAX_LEN
Returns a random password between MIN_LEN and MAX_LEN characters long.

  SetPassword
Takes a string. Checks the string's length and sets this user's password to that string.

  IsPassword
Returns true if the passed in value is this user's password. Returns undef otherwise.

  Sub SetDisabled
Toggles the user's disabled flag. If this flag is set, all password checks for this user will fail. All ACL checks for this user will fail. The user will appear in no user listings.

  GrantQueueRight
Grant a queue right to this user. Takes a paramhash of which the elements RightAppliesTo and RightName are important.

  GrantSystemRight
Grant a system right to this user. The only element that's important to set is RightName.

  HasQueueRight
Takes a paramhash which can contain these items:
    TicketObj => RT::Ticket or QueueObj => RT::Queue or Queue => integer
    IsRequestor => undef, (for bootstrapping create)
    Right => 'Right'

Returns 1 if this user has the right specified in the paramhash. for the queue passed in.

Returns undef if they don't

  HasSystemRight
takes an array of a single value and a paramhash. The single argument is the right being passed in. the param hash is some additional data. (IsCc, IsOwner, IsAdminCc and IsRequestor)

Returns 1 if this user has the listed 'right'. Returns undef if this user doesn't.

  sub _HasRight (Right => 'right', Scope => 'scope', AppliesTo => int, ExtendedPrincipals => SQL)
_HasRight is a private helper method for checking a user's rights. It takes several options:

Right is a textual right name
Scope is a textual scope name. (As of July these were Queue, Ticket and System
AppliesTo is the numerical Id of the object identified in the scope. For tickets, this is the queue #. for queues, this is the queue #
ExtendedPrincipals is an  SQL select clause which assumes that the only table in play is ACL.  It's used by HasQueueRight to pass in which metaprincipals apply. Actually, it's probably obsolete. TODO: remove it.
    Returns 1 if a matching ACE was found.

    Returns undef if no ACE was found.

  CurrentUserCanModify RIGHT
If the user has rights for this object, either because he has 'AdminUsers' or (if he\'s trying to edit himself and the right isn\'t an admin right) 'ModifySelf', return 1. otherwise, return undef.

  CurrentUserHasRight
  Takes a single argument. returns 1 if $Self->CurrentUser
  has the requested right. returns undef otherwise

  _Value
Takes the name of a table column. Returns its value as a string, if the user passes an ACL check

POD ERRORS
Hey! The above document had some coding errors, which are explained below:

Around line 846:
    '=item' outside of any '=over'

Around line 1090:
    You forgot a '=back' before '=head2'