<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 31, 2013 at 7:02 AM, Ruslan Zakirov <span dir="ltr"><<a href="mailto:ruz@bestpractical.com" target="_blank">ruz@bestpractical.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">You still don't check return value of GrantRight correctly, see examples in RT.</div>

<div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On Fri, May 31, 2013 at 6:20 AM, Asif Iqbal <span dir="ltr"><<a href="mailto:vadud3@gmail.com" target="_blank">vadud3@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">

<div>On Thu, May 30, 2013 at 5:51 PM, Ruslan Zakirov <span dir="ltr"><<a href="mailto:ruz@bestpractical.com" target="_blank">ruz@bestpractical.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">You don't check any return value.</div>




<div class="gmail_extra"><br><br></div></blockquote><div><br></div></div><div>added the check return and did not disclose any error</div><div><div><br></div><div>if (!$queue->Load( 'Help' )) {</div>

<div> die $@;</div><div>};</div><div><br></div><div><div>if (!$group->LoadSystemRoleGroup( 'Requestor' )){</div><div> die $@;</div><div>};</div></div><div><br></div><div><div>if (!$group->PrincipalObj->GrantRight( Object => $queue, Right => 'ShowTicket' )){</div>




<div> die $@;</div><div>};</div></div><div><br></div><div>Help Queue Group Rights still not adding Role Requestor with Right  ShowTicket</div><div><br></div><div>But then I realized I am using the wrong method. </div>

<div><br></div><div>I changed it to LoadQueueRoleGroup and it is working now.</div><div><br></div><div>replaced this</div><div>  </div><div>    $group->LoadSystemRoleGroup( 'Requestor' );</div>

<div><br></div><div>with this</div><div>  </div><div>   $group->LoadQueueRoleGroup( Queue => $queue->id, Type => 'Requestor' );</div><div><br></div><div><br></div><div> <br></div></div><div><div>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="gmail_extra"><div class="gmail_quote"><div>
<div>On Fri, May 31, 2013 at 1:05 AM, Asif Iqbal <span dir="ltr"><<a href="mailto:vadud3@gmail.com" target="_blank">vadud3@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div><div dir="ltr">Hi All<div><br></div>




<div>I am trying this and I do not the right gets added. </div>
<div><br></div><div>
<div>use strict;</div><div>use lib '/opt/rt3/lib';</div><div><br></div><div>use RT;<br></div><div>

use RT::Interface::CLI;</div><div>use Data::Dumper;</div><div><br></div><div>RT::LoadConfig();</div><div>RT::Init();</div><div><br></div><div>my $queue = RT::Queue->new( $RT::SystemUser );<br></div><div><br></div><div>








my $group = RT::Group->new( $RT::SystemUser );<br></div><div><br></div><div>$queue->Load( 'Help' );</div><div><br></div><div>$group->LoadSystemRoleGroup( 'Requestor' );</div><div><br></div><div>$group->PrincipalObj->GrantRight( Object => $queue, Right => 'ReplyToTicket' );</div>

</div></div></div></div></blockquote></div></div></blockquote></div></div></div></div></div></blockquote></div></div></div></div></blockquote><div><br></div><div><br></div><div><br></div><div>my ( $status, $msg ) = $group->PrincipalObj->GrantRight( Object => $queue, Right => 'ShowTicket' );</div>

<div>print $msg . "\n";</div><div><br></div><div style>results  </div><div style><br></div><div style>That principal already has that right<br></div><div style><br></div><div style>doh!</div><div style><br></div>

<div style>Thanks a lot for your help</div><div style><br></div><div style><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div class="gmail_extra"><div><div class="h5"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div>

<div dir="ltr"><div>






<div><br></div><div>What am I doing wrong?</div><span><font color="#888888"><div><br></div>-- <br>Asif Iqbal<br>PGP Key: 0xE62693C5 KeyServer: <a href="http://pgp.mit.edu" target="_blank">pgp.mit.edu</a><br>
A: Because it messes up the order in which people normally read text.<br>

Q: Why is top-posting such a bad thing?<br><br>
</font></span></div></div>
<br><br>
<br></div></div><span><font color="#888888">
--<br>
RT Training in Seattle, June 19-20: <a href="http://bestpractical.com/training" target="_blank">http://bestpractical.com/training</a><br></font></span></blockquote></div><span><font color="#888888"><br><br clear="all">
<div><br></div>-- <br>Best regards, Ruslan.
</font></span></div>
</blockquote></div></div></div><div><div><br><br clear="all"><div><br></div>-- <br>Asif Iqbal<br>PGP Key: 0xE62693C5 KeyServer: <a href="http://pgp.mit.edu" target="_blank">pgp.mit.edu</a><br>A: Because it messes up the order in which people normally read text.<br>





Q: Why is top-posting such a bad thing?<br><br>
</div></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class=""><font color="#888888">-- <br>Best regards, Ruslan.
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Asif Iqbal<br>PGP Key: 0xE62693C5 KeyServer: <a href="http://pgp.mit.edu">pgp.mit.edu</a><br>A: Because it messes up the order in which people normally read text.<br>

Q: Why is top-posting such a bad thing?<br><br>
</div></div>