<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=GlobalObjects</id>
	<title>GlobalObjects - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=GlobalObjects"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=GlobalObjects&amp;action=history"/>
	<updated>2026-08-22T22:37:26Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=GlobalObjects&amp;diff=1437&amp;oldid=prev</id>
		<title>Admin: 2 revisions imported</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=GlobalObjects&amp;diff=1437&amp;oldid=prev"/>
		<updated>2016-04-06T20:11:16Z</updated>

		<summary type="html">&lt;p&gt;2 revisions imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== [=$RT::Logger] object ==&lt;br /&gt;
&lt;br /&gt;
Logging framework in RT is based on Log::Dispatch(http://search.cpan.org/dist/Log-Dispatch) distribution. [[Debug]] describe how to configure logging in RT and list all available log levels.&lt;br /&gt;
&lt;br /&gt;
[=RT::[[InitLogging]]()] sub init this object while RT initializing.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
 $RT::Logger-&amp;amp;gt;debug( &amp;#039;debug entry&amp;#039; );&lt;br /&gt;
 $RT::Logger-&amp;amp;gt;critical( &amp;#039;Something terrible goes wrong&amp;#039; );&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
You can use this object in Core, Web UI and CLI tools.&lt;br /&gt;
&lt;br /&gt;
== [=$RT::SystemUser] object ==&lt;br /&gt;
&lt;br /&gt;
The object of the [=RT::[[CurrentUser]]] class that represent RT system. This user has global [[SuperUser]] right. You can use this object as argument to constructors of &amp;lt;code&amp;gt;RT::Record&amp;lt;/code&amp;gt; objects. Very useful when you want to do something with RT record and want to be sure that operation wouldn&amp;#039;t fail because of permissions problems.&lt;br /&gt;
&lt;br /&gt;
See also [[ObjectModel]] section CurrentUser&lt;br /&gt;
&lt;br /&gt;
== [=$RT::Nobody] object ==&lt;br /&gt;
&lt;br /&gt;
Similar as above, but represent user &amp;lt;code&amp;gt;Nobody&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 if( $TicketObj-&amp;amp;gt;Owner == $RT::Nobody-&amp;amp;gt;Id ) {&lt;br /&gt;
   # ticket has no owner yet, now, owner is nobody&lt;br /&gt;
   ...&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== [=$RT::System] object ==&lt;br /&gt;
&lt;br /&gt;
RT object that represents the RT system itself and is used to check global rights.&lt;br /&gt;
&lt;br /&gt;
 $user_obj-&amp;amp;gt;HasRight(Right =&amp;amp;gt; &amp;#039;AdminUsers&amp;#039;, Object =&amp;amp;gt; $RT::System);&lt;br /&gt;
&lt;br /&gt;
Code checks whether user has global right &amp;#039;[[AdminUsers]]&amp;#039; on success return true in other case false.&lt;br /&gt;
&lt;br /&gt;
== [=%session] hash (Web UI only) ==&lt;br /&gt;
&lt;br /&gt;
The Session hash is available in Web UI code only and is used to store user related info. This hash is persistent between requests but only while the session is the same. By default RT uses &amp;quot;session&amp;quot; cookies to track users, the browser typically deletes such cookies if you close it. This object is based on class from [http://search.cpan.org/dist/Apache-Session Apache::Session] distribution.&lt;br /&gt;
&lt;br /&gt;
Hash has standard keys that can be useful in your code:&lt;br /&gt;
&lt;br /&gt;
* [=$session{&amp;#039;[[CurrentUser]]&amp;#039;}] - object of the RT::User class that represent user making current request&lt;br /&gt;
* &amp;lt;code&amp;gt;$session{&amp;#039;i&amp;#039;}&amp;lt;/code&amp;gt; - magic variable to force storing of data. Session data is stored only if you change some value in its hash directly only. For eg: changing the real name of the current user doesn&amp;#039;t change the session hash because there is a stored reference on the object in the hash, so Apache::Session thinks that data is unchanged and doesn&amp;#039;t renew it in storage. traditionally RT uses the following trick &amp;lt;code&amp;gt;$session{&amp;#039;i&amp;#039;}++&amp;lt;/code&amp;gt;.&lt;br /&gt;
* ... there are other things that are stored in this hash under different conditions in RT. Grep in Web UI code and/or feel free to describe it here.&lt;br /&gt;
&lt;br /&gt;
== Config options ==&lt;br /&gt;
&lt;br /&gt;
All options that you define in the RT config files are also global variables in RT namespace. You can use them in your code &amp;#039;&amp;#039;&amp;#039;read-only&amp;#039;&amp;#039;&amp;#039;. Yes, you can change them, but don&amp;#039;t do that without &amp;lt;code&amp;gt;local&amp;lt;/code&amp;gt; and do it only if you know what are you doing and why.&lt;br /&gt;
&lt;br /&gt;
 $RT::rtname&lt;br /&gt;
 $RT::Organisation&lt;br /&gt;
 $RT::NotifyActor&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
See [=[[RT Config|RT_Config]].pm] file for full list of options.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>