Re: Hide ticket history change

354 views
Skip to first unread message

RjOllos

unread,
Jul 6, 2012, 1:13:56 AM7/6/12
to trac-...@googlegroups.com
On Thursday, July 5, 2012 3:29:03 PM UTC-7, Daniel França wrote:
Hi, 
I wanto to know if it's possible to hide ticket change history for some groups or permissions...
I'd google it and I've find that: http://trac.edgewall.org/ticket/6840
but it seems to work only to hide sensitive ticket, not to hide only the change history for specific groups.

Anyone know some good solution for this case?

If you were trying to hide a realm or specific resource (ticket, milestones, pastebin, etc ..), then FineGrainPermissions would help you. In this case, the only possible way I know of is to write a plugin that adds a TICKET_VIEW_COMMENT permission and implements ITemplateStreamFilter to strip out the HTML for the comment history for users that don't have that permission. Similarly, SimpleTicketPlugin does this for fields on the newticket form (and BlackMagicTicketTweaksPlugin has much of the same functionality).

I'd be interested to know if someone has a better way to go about this, but the way I proposed I think is just a 20-30 LOC plugin.

RjOllos

unread,
Jul 6, 2012, 2:51:49 AM7/6/12
to trac-...@googlegroups.com
SimpleTicketPlugin implements IRequestFilter, which I guess is upstream of ITemplateStreamFilter, so maybe that's the better way to do it. The attached example plugin adds a TICKET_VIEW_COMMENT permission that a user must have to view ticket comments. It is over-ridden by having TRAC_ADMIN permission.
commentpermplugin.zip

Daniel França

unread,
Jul 6, 2012, 3:28:06 PM7/6/12
to trac-...@googlegroups.com
Thanks guys, I'm gonna look at that.


On Fri, Jul 6, 2012 at 3:51 AM, RjOllos <ry...@physiosonics.com> wrote:
SimpleTicketPlugin implements IRequestFilter, which I guess is upstream of ITemplateStreamFilter, so maybe that's the better way to do it. The attached example plugin adds a TICKET_VIEW_COMMENT permission that a user must have to view ticket comments. It is over-ridden by having TRAC_ADMIN permission.

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/trac-users/-/v00KXmw9kWoJ.

To post to this group, send email to trac-...@googlegroups.com.
To unsubscribe from this group, send email to trac-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.

RjOllos

unread,
Jul 6, 2012, 3:34:50 PM7/6/12
to trac-...@googlegroups.com
One additional thing to be aware of is that all of the plugins that hide resources: PrivateTickets, SensitiveTickets, SimpleTicket and the attached example; have a fail-open mode, which basically means that if the plugins unloads, the thing that is being hidden will be made visible to the users you are hiding it from. There doesn't seem to be a way around this right now.

More info here:
http://trac-hacks.org/ticket/5784
Reply all
Reply to author
Forward
0 new messages