RT 5.0.1 Documentation

RT::CurrentUser

Go to latest version →

NAME

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

SYNOPSIS

    use RT::CurrentUser;

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

    # manipulation
    $current_user->UserObj->SetName('new_name');

DESCRIPTION

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.

METHODS

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

new

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.

UserObj

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

LoadByGecos

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

LoadByName

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

LanguageHandle

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

CurrentUser

Return the current currentuser object

← Back to index