[rt-users] Using !Group in queue permissions
Todd Chapman
rt at chaka.net
Wed Dec 22 23:02:49 EST 2004
I think this would be cleaner:
if ($QueueObj->CurrentUserHasRight('CreateTicket')) {
On Wed, Dec 22, 2004 at 03:35:20PM -0500, Andy Harrison wrote:
> > 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
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Be sure to check out the RT wiki at http://wiki.bestpractical.com
More information about the rt-users
mailing list