[Rt-devel] Patch - don't show "New ticket" in self service if user doesn't have right

Jesse Vincent jesse at bestpractical.com
Wed Sep 16 11:01:20 EDT 2009


A quick read of this patch suggests that it will break if you've granted
the user 'create ticket' rights at the queue level.


On Wed, Sep 16, 2009 at 03:40:01PM +0100, Chris Howells wrote:
> Hi,
> 
> The following patch prevents the "New Ticket" option being show in the
> self service interface if the user doesn't have the CreateTicket right.
> 
> This should lead to less confusion, I think.
> 
> (apply in html/SelfService/Elements)
> 
> ==== start ====
> --- Tabs.backup 2009-09-16 12:00:15.000000000 +0000
> +++ Tabs        2009-09-16 12:04:02.000000000 +0000
> @@ -83,14 +83,18 @@ my $tabs = { A  => { title => loc('Open
>                         },
>             };
> 
> -if ($queue_count > 1) {
> -        $tabs->{C} = { title => loc('New ticket'),
> -                       path => 'SelfService/CreateTicketInQueue.html'
> +if ($session{'CurrentUser'}->HasRight( Right => 'CreateTicket',
> +                                      Object => $RT::System )) {
> +
> +       if ($queue_count > 1) {
> +                       $tabs->{C} = { title => loc('New ticket'),
> +                               path =>
> 'SelfService/CreateTicketInQueue.html'
>                         };
> -} else {
> +       } else {
>          $tabs->{C} = { title => loc('New ticket'),
>                         path => 'SelfService/Create.html?Queue=' . $queue_id
>                         };
> +       }
>  }
> 
>  if ($session{'CurrentUser'}->HasRight( Right => 'ModifySelf',
> ==== end ====
> 
> It would be great to see this applied to RT. As I don't particularly
> understand RT coding style and indentation, hopefully someone can tidy
> this up for me.
> 
> Thanks.
> 
> 
> _______________________________________________
> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel
> 

-- 


More information about the Rt-devel mailing list