[rt-users] [SOLVED] Redirect when no access / no rights?

Ruslan Zakirov ruz at bestpractical.com
Fri Apr 19 12:56:56 EDT 2013


On Fri, Apr 19, 2013 at 8:41 PM, Patrick G. Stoesser <lists at pgs-info.de>wrote:

> Hello,
>
> this modification works for me: In
>
> RTLOCAL/html/Ticket/Display.**html, around line 180,
>
> change
>
> # XXX: we shouldn't block actions here if user has no right to see the
> # ticket,
> # but we should allow him to see actions he has done
>         unless ($TicketObj->**CurrentUserHasRight('**ShowTicket')) {
>         Abort("No permission to view ticket");
>         }
>
> to
>
> # XXX: we shouldn't block actions here if user has no right to see the
> # ticket,
> # but we should allow him to see actions he has done
>         unless ($TicketObj->**CurrentUserHasRight('**ShowTicket')) {
> ##### begin mod redirect when no permission ############################
> #       Abort("No permission to view ticket");
> RT::Interface::Web::Redirect(**RT->Config->Get('WebURL').'**index.html');
> ###### end mod redirect when no permission #############################
>         }
>
>
> From now on, when a user has no right to see a ticket, he will be
> immediately redirected to index.html (RT at a glance).
>
> Possible drawback of my solution: The user does not get an explicit error
> message ("No permission to view ticket") anymore.
>

I pointed you at MaybeRedirectForResults for a reason, it stashes messages
and those will be displayed on "RT at glance page".



> A possible solution could be to give out the error status and redirect
> after one or two seconds to index.html.
>
> Kind regards,Patrick
>
>
>
> Am 12.04.2013 15:05, schrieb Patrick G. Stoesser:
>
>  Hello,
>>
>> as described in <514C70F2.1040200 at pgs-info.de>**, I run two queues,
>> Level1 and Level2. My Level2 users now have a custom status
>> "returned". When chosing this status for a ticket, the ticket will
>> change the queue to Level1, will be set to unowned and escalations
>> will be reset to the beginning. This whole thing works fine.
>>
>> The only thing: As soon as the tickets' level is set to "returned"
>> and so the queue has changed, the user gets an error site: "No
>> permission to view ticket"
>>
>> Which is correct, because the ticket has left his queue.
>>
>> Is it possible to redirect the user to his RT at a glance site in
>> this case? Yes, it's jaust a click, but a displayed error may be
>> disturbing for the user, especially when he did nothing wrong.
>>
>> Thanks in advence, Patrick
>>
>
>


-- 
Best regards, Ruslan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20130419/a9f3f70a/attachment.htm>


More information about the rt-users mailing list