<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
p
{mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman";}
span.EmailStyle18
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
@page Section1
{size:595.3pt 841.9pt;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-AU link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Really? You aren’t creating an
instance of “RT::Queues” are you? Rather than RT::Queue<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Regards,<br>
Matt.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
Brelsfoard, Alex [mailto:alexb@WPI.EDU] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday, March 31, 2005
6:44 AM<br>
<b><span style='font-weight:bold'>To:</span></b> Matthew Watson;
rt-users@lists.bestpractical.com<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [rt-users] Displaying
a section based on access to a queue--Answer</span></font><span lang=EN-US><o:p></o:p></span></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>This seems like a great idea. but
when I try to implement it I get an error saying that it does not recognize the
Load method.</span></font><o:p></o:p></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>Any ideas?</span></font><o:p></o:p></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>--Alex</span></font><o:p></o:p></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>
</div>
<p><font size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New"'><!-- Converted from text/rtf format -->Alex
Brelsfoard</span></font> <br>
<font size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New"'>Web Applications Developer</span></font> <br>
<font size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New"'>Web Development Office</span></font> <br>
<font size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New"'>Worcester Polytechnic Institute</span></font> <br>
<font size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New"'>508-831-6147</span></font> <br>
<font size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New"'>alexb@wpi.edu</span></font><span lang=EN-US> </span><o:p></o:p></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabIndex=-1>
</span></font></div>
<p class=MsoNormal style='margin-bottom:12.0pt'><b><font size=2 face=Tahoma><span
lang=EN-US style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
Matthew Watson [mailto:matthew.watson@staff.netspace.net.au] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, March 30, 2005
5:12 PM<br>
<b><span style='font-weight:bold'>To:</span></b> Brelsfoard, Alex;
rt-users@lists.bestpractical.com<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [rt-users] Displaying
a section based on access to a queue--Answer</span></font><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>That’s a pretty messy way of doing
it, you are looping over all the queues but only doing any action if the queue
is “8” , it would be better to just load queue 8 and test on that.
Something like this,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>% my $q = new
RT::Queue($session{‘CurrentUser’});<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>% $q->Load(‘8’);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>% if ($q->Id &&
$q->CurrentUserHasRight(“SeeQueue”)){<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><br><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> <& /Element/MyElements
&><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><br><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>% }<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>This should scale a lot better as you get
more queues.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Matt.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabIndex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Brelsfoard, Alex<br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday, March 31, 2005
5:02 AM<br>
<b><span style='font-weight:bold'>To:</span></b>
rt-users@lists.bestpractical.com<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [rt-users] Displaying
a section based on access to a queue--Answer</span></font><span lang=EN-US><o:p></o:p></span></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>I played around long enough and found a
solution to this. I figured I'd share with everyone:</span></font><o:p></o:p></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>%my $q=new
RT::Queues($session{'CurrentUser'});<br>
%$q->UnLimit;<br>
%my $cansee = 0;<br>
%while (my $queue=$q->Next) {<br>
% if ($queue->id == 8) {<br>
% if ($queue->CurrentUserHasRight('SeeQueue')) {<br>
% $cansee = 1;<br>
% }<br>
% }<br>
%}<br>
%<br>
%if ($cansee) {<br>
<br><br>
<& /Elements/MyElement &><br>
<br><br>
%}</span></font><o:p></o:p></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>--Alex</span></font><o:p></o:p></p>
</div>
<p><font size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New"'><!-- Converted from text/rtf format -->Alex
Brelsfoard</span></font> <br>
<font size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New"'>Web Applications Developer</span></font> <br>
<font size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New"'>Web Development Office</span></font> <br>
<font size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New"'>Worcester Polytechnic Institute</span></font> <br>
<font size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New"'>508-831-6147</span></font> <br>
<font size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New"'>alexb@wpi.edu</span></font><span lang=EN-US> </span><o:p></o:p></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabIndex=-1>
</span></font></div>
<p class=MsoNormal style='margin-bottom:12.0pt'><b><font size=2 face=Tahoma><span
lang=EN-US style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Brelsfoard, Alex<br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, March 30, 2005
11:22 AM<br>
<b><span style='font-weight:bold'>To:</span></b>
rt-users@lists.bestpractical.com<br>
<b><span style='font-weight:bold'>Subject:</span></b> [rt-users] Displaying a
section based on access to a queue</span></font><span lang=EN-US><o:p></o:p></span></p>
<div>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I would like to have something displayed only if the person
logged in has access to a particular queue or is a member of a
specific group.</span></font><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Basically:</span></font><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>% if ($UserIsMemberOfGroup("MyGroup") {</span></font><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><& /Elements/MyElement &></span></font><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>% }</span></font><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Well, that's the general gist of what I want. Any idea
of what the proper syntax is?</span></font><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Thanks.</span></font><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>--Alex</span></font><o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>
</div>
<p><font size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New"'><!-- Converted from text/rtf format -->Alex
Brelsfoard</span></font> <br>
<font size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New"'>Web Applications Developer</span></font> <br>
<font size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New"'>Web Development Office</span></font> <br>
<font size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New"'>Worcester Polytechnic Institute</span></font> <br>
<font size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New"'>508-831-6147</span></font> <br>
<font size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New"'>alexb@wpi.edu</span></font><span lang=EN-US> </span><o:p></o:p></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>
</div>
</div>
<p><font size=1 face=Arial><span style='font-size:7.5pt;font-family:Arial'><!--[object_id=#staff.netspace.net.au#]-->This
email and any files transmitted with it are confidential and intended solely
for the use of the individual or entity to whom they are addressed. Please
notify the sender immediately by email if you have received this email by
mistake and delete this email from your system. Please note that any views or
opinions presented in this email are solely those of the author and do not
necessarily represent those of the organisation. Finally, the recipient should
check this email and any attachments for the presence of viruses. The
organisation accepts no liability for any damage caused by any virus
transmitted by this email.</span></font><o:p></o:p></p>
</div>
</div>
</body>
</html>