RT 5.0.5 Documentation

RT::System

Go to latest version →

NAME

RT::System

DESCRIPTION

RT::System is a simple global object used as a focal point for things that are system-wide.

It works sort of like an RT::Record, except it's really a single object that has an id of "1" when instantiated.

This gets used by the ACL system so that you can have rights for the scope "RT::System"

In the future, there will probably be other API goodness encapsulated here.

AvailableRights

Returns a hashref of available rights for this object. The keys are the right names and the values are a description of what the rights do.

This method as well returns rights of other RT objects, like RT::Queue or RT::Group, to allow users to apply those rights globally.

If an RT::Principal is passed as the first argument, the available rights will be limited to ones which make sense for the principal. Currently only role groups are supported and rights announced by object types to which the role group doesn't apply are not returned.

RightCategories

Returns a hashref where the keys are rights for this type of object and the values are the category (General, Staff, Admin) the right falls into.

id

Returns RT::System's id. It's 1.

Load

Since this object is pretending to be an RT::Record, we need a load method. It does nothing

QueueCacheNeedsUpdate ( 1 )

Attribute to decide when SelectQueue needs to flush the list of queues and retrieve new ones. Set when queues are created, enabled/disabled and on certain acl changes. Should also better understand group management.

If passed a true value, will update the attribute to be the current time.

CustomRoleCacheNeedsUpdate ( 1 )

Attribute to decide when we need to flush the list of custom roles and re-register any changes. Set when roles are created, enabled/disabled, etc.

If passed a true value, will update the attribute to be the current time.

ConfigCacheNeedsUpdate ( 1 )

Attribute to decide when we need to flush the database settings and re-register any changes. Set when settings are created, enabled/disabled, etc.

If passed a true value, will update the attribute to be the current time.

LifecycleCacheNeedsUpdate ( 1 )

Attribute to decide when we need to flush the list of lifecycles and re-register any changes. This is needed for the lifecycle UI editor.

If passed a true value, will update the attribute to be the current time.

AddUpgradeHistory package, data

Adds an entry to the upgrade history database. The package can be either RT for core RT upgrades, or the fully qualified name of a plugin. The data must be a hash reference.

UpgradeHistory [package]

Returns the entries of RT's upgrade history. If a package is specified, the list of upgrades for that package will be returned. Otherwise a hash reference of package => [upgrades] will be returned.

ExternalStorage

Accessor for the storage engine selected by RT::ExternalStorage. Will be undefined if external storage is not configured.

ExternalStorageURLFor object

Returns a URL for direct linking to an RT::ExternalStorage engine. Will return undef if external storage is not configured, or if direct linking is disabled in config ($ExternalStorageDirectLink), or if the external storage engine doesn't support hyperlinking (as in RT::ExternalStorage::Disk), or finally, if the object is for whatever reason not present in external storage.

UserMessages

Returns a hash with keys of message codes and values with corresonding user messages.

To add messages, create entries in %USER_MESSAGES with an appropriate message code as the key.

To trigger display of that message, add an entry to notes, prefixed with Message:, like:

    if ( $something_happened ) {
        $HTML::Mason::Commands::m->notes('Message:SQLTimeout' => 1 );
    }

For the web UI, Elements/Footer will pick that up and display the message to the user in the browser.

CurrentUserCanSee TYPE, OBJECT

Return false if TYPE is "Transaction" and current user is not "SuperUser", returns true otherwise.

← Back to index