[rt-users] Using !Group in queue permissions

Andy Harrison aharrison at gmail.com
Wed Dec 22 15:35:20 EST 2004


> It would have been nicer to have a method of determining whether the
> current user has a right to own tickets on the queue before listing
> those tickets here but I don't know how to do that. Determining user
> rights seems to be somewhat involved and not something one can make a
> clause in the Elements/TicketList query. I hope someone will correct me
> if I'm wrong.

% my $QueueObj      = new RT::Queue( $session{ 'CurrentUser' } );
% $QueueObj->Load( 45 );
% if (  $session{CurrentUser}->HasRight( Right => 'CreateTicket',
Object => $QueueObj ) ) {
%     ... some code ...
<foo> or some html </foo>
% }

The $QueueObj->Load is necessary because at this point in the process,
the user is not in a queue.  Change the Right from CreateTicket to
whatever you're interested in checking.

      rightname       
----------------------
 AdminCustomFields
 AdminGroup
 AdminGroupMembership
 AdminQueue
 CommentOnTicket
 CreateTicket
 DeleteTicket
 EditSavedSearches
 ModifyACL
 ModifyOwnMembership
 ModifyQueueWatchers
 ModifyScrips
 ModifyTemplate
 ModifyTicket
 OwnTicket
 ReplyToTicket
 SeeQueue
 ShowACL
 ShowOutgoingEmail
 ShowSavedSearches
 ShowScrips
 ShowTemplate
 ShowTicket
 ShowTicketComments
 StealTicket
 SuperUser
 TakeTicket
 Watch
 WatchAsAdminCc


-- 
Andy Harrison



More information about the rt-users mailing list