Peter's plugin shown above work for me on 1.0-stable, and users aren't able 
to edit comments even if they have been granted TICKET_ADMIN. I used 
resolution //signed// rather than //Signed// since all of Trac's predefined 
resolutions are in lowercase.

I'm running version 1.0

On Monday, July 28, 2014 11:31:56 AM UTC-7, RjOllos wrote:
>
> On Mon, Jul 28, 2014 at 10:55 AM, Jared Bownds <[email protected] 
> <javascript:>> wrote:
>
>> You nailed it!  The code below works.  However, users are still able to 
>> 'edit' their own comments once a ticket is resolved as signed.   
>>
>> {{{
>> from trac.core import *
>> from trac.perm import IPermissionPolicy
>> from trac.ticket.model import Ticket
>>
>> class ReadonlySignedTickets(Component):
>>     implements(IPermissionPolicy)
>>
>>     def check_permission(self, action, username, resource, perm):
>>         if resource is None or resource.realm != 'ticket' or \
>>            resource.id is None or action == 'TICKET_VIEW' or \
>>            action == 'TRAC_ADMIN' or 'TRAC_ADMIN' in perm:
>>
>>             return None
>>
>>         t = Ticket(self.env, resource.id)
>>         if t['resolution'] == 'signed':
>>             return False
>> }}}
>>
>
> Peter's plugin shown above work for me on 1.0-stable, and users aren't 
> able to edit comments even if they have been granted TICKET_ADMIN. I used 
> resolution //signed// rather than //Signed// since all of Trac's predefined 
> resolutions are in lowercase.
>
> Which Trac version are you running?
>
> I'm running version 1.0
>  
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to