RT 4.0.25 Documentation

This version has reached its end of life and is out of support. Please contact us for upgrade assistance.


Go to latest version →


  RT::CurrentUser - an RT object representing the current user


    use RT::CurrentUser;

    # load
    my $current_user = RT::CurrentUser->new;
    # or
    my $current_user = RT::CurrentUser->new( $user_obj );
    # or
    my $current_user = RT::CurrentUser->new( $address || $name || $id );

    # manipulation


Read-only subclass of RT::User class. Used to define the current user. You should pass an instance of this class to constructors of many RT classes, then the instance used to check ACLs and localize strings.


See also RT::User for a list of methods this class has.


Returns new CurrentUser object. Unlike all other classes of RT it takes either subclass of RT::User class object or scalar value that is passed to Load method.

Create, Delete and Set*

As stated above it's a subclass of RT::User, but this class is read-only and calls to these methods are illegal. Return 'permission denied' message and log an error.


Returns the RT::User object associated with this CurrentUser object.


Loads a User into this CurrentUser object. Takes a unix username as its only argument.


Loads a User into this CurrentUser object. Takes a Name.


Returns this current user's langauge handle. Should take a language specification. but currently doesn't


Return the current currentuser object


Takes $password, $created and $nonce, and returns a boolean value representing whether the authentication succeeded.

If both $nonce and $created are specified, validate $password against:

        $nonce .
        $created .
        sha1_hex( "$username:$realm:$server_pass" )

where $server_pass is the md5_hex(password) digest stored in the database, $created is in ISO time format, and $nonce is a random string no longer than 32 bytes.

← Back to index