Re: [Trac] Read only ticket according to custom resolution type

2015-12-11 Thread Ahmed M.
Here is what I did, I put the code in a .py file in the plugins directory and enabled it in the trac ini file - see attached screenshots. No change what so ever! I don't even see the plugin in the web admin screen! So I read again the above threads and found that I need to update my

Re: [Trac] Read only ticket according to custom resolution type

2015-12-11 Thread Ahmed M.
I take that back - it was an indentation issue with my script, fixed it and IT WORKS! Thank you so much for your help! Ahmed On Friday, December 11, 2015 at 9:54:30 AM UTC-5, Ahmed M. wrote: > > Here is what I did, I put the code in a .py file in the plugins directory > and enabled it in the

Re: [Trac] Read only ticket according to custom resolution type

2015-12-10 Thread Ahmed M.
I want to apply this to all closed tickets (no special resolution) and I am not having much luck. I tried to change the line if t['resolution'] == 'fixed', if t['resolution'] == 'closed' but nothing happened. any idea how I can debug\fix this? Thanks, On Monday, July 28, 2014 at 2:31:56 PM

Re: [Trac] Read only ticket according to custom resolution type

2014-08-03 Thread Jared Bownds
Hi Ryan, My present challenge with the latter permission policy configuration and ReadonlySignedTickets.py is that all users but TRAC_ADMIN are unable to comment on any ticket, irrespective of its status (new, assigned, open, closed as closed). In summary, it's simply not working as desired.

Re: [Trac] Read only ticket according to custom resolution type

2014-08-03 Thread Jared Bownds
Alright, permissions are now working properly. For some reason I omitted the last if statement qualifying the resolution type. Moving forward, I'm having a problem with the visual indication here http://trac.edgewall.org/wiki/CookBook/Configuration/SignedTickets#Visualindication. I can see in

Re: [Trac] Read only ticket according to custom resolution type

2014-08-03 Thread Ryan Ollos
On Sun, Aug 3, 2014 at 7:34 PM, Jared Bownds jared.bow...@gmail.com wrote: Alright, permissions are now working properly. For some reason I omitted the last if statement qualifying the resolution type. Moving forward, I'm having a problem with the visual indication here

Re: [Trac] Read only ticket according to custom resolution type

2014-08-01 Thread Jared Bownds
Okay, hopefully this is the last iteration! Using the code below as our example, for some reason users who are not TRAC_ADMIN are unable to comment or modify tickets, irrespective of resolution status. Also, I've included my permission policy configuration below. *ReadonlySignedTickets.py* {{{

Re: [Trac] Read only ticket according to custom resolution type

2014-08-01 Thread Ryan Ollos
On Fri, Aug 1, 2014 at 10:52 AM, Jared Bownds jared.bow...@gmail.com wrote: Okay, hopefully this is the last iteration! Using the code below as our example, for some reason users who are not TRAC_ADMIN are unable to comment or modify tickets, irrespective of resolution status. Also, I've

Re: [Trac] Read only ticket according to custom resolution type

2014-07-30 Thread Jared Bownds
Hi Ryan, Thanks for your help so far. I now have the plugin loading, however even users with TICKET_VIEW permissions are now unable to view tickets resolved as Signed. Any idea why this may be happening? [image: Inline image 3] 2014-07-30 07:11:07,965 Trac[perm] DEBUG: ReadonlySignedTickets

Re: [Trac] Read only ticket according to custom resolution type

2014-07-30 Thread Peter Suter
Hi On 30.07.2014 16:14, Jared Bownds wrote: Thanks for your help so far. I now have the plugin loading, however even users with TICKET_VIEW permissions are now unable to view tickets resolved as Signed. Any idea why this may be happening? Probably because you switched the allowed action

Re: [Trac] Read only ticket according to custom resolution type

2014-07-30 Thread Jared Bownds
That was it, thanks for pointing it out. On Wed, Jul 30, 2014 at 7:36 AM, Peter Suter petsu...@gmail.com wrote: Hi On 30.07.2014 16:14, Jared Bownds wrote: Thanks for your help so far. I now have the plugin loading, however even users with TICKET_VIEW permissions are now unable to view

Re: [Trac] Read only ticket according to custom resolution type

2014-07-29 Thread Jared Bownds
Hi Ryan, ReadonlySignedTickets.py (outlined below) is not working for me. Moreover, I can tell in the Trac log that the plugin is being considered. I've tried both *if t['resolution'] == 'Signed': *and *if t['resolution'] == 'signed':* Any thoughts? ReadonlySignedTickets.py {{{ from

Re: [Trac] Read only ticket according to custom resolution type

2014-07-29 Thread Ryan Ollos
On Tue, Jul 29, 2014 at 7:14 AM, Jared Bownds jared.bow...@gmail.com wrote: Hi Ryan, ReadonlySignedTickets.py (outlined below) is not working for me. Moreover, I can tell in the Trac log that the plugin is being considered. I've tried both *if t['resolution'] == 'Signed': *and *if

Re: [Trac] Read only ticket according to custom resolution type

2014-07-29 Thread Jared Bownds
Hi Ryan, Here are the values for permissions_policies in trac.ini and the log results for user temp1 when updating a ticket resolved as Signed. *[trac]* permission_policies = ReadonlySignedTickets, DefaultPermissionPolicy, LegacyAttachmentPolicy *Log* 2014-07-29 14:00:13,616 Trac[session]

Re: [Trac] Read only ticket according to custom resolution type

2014-07-29 Thread Ryan Ollos
On Tue, Jul 29, 2014 at 2:02 PM, Jared Bownds jared.bow...@gmail.com wrote: Hi Ryan, Here are the values for permissions_policies in trac.ini and the log results for user temp1 when updating a ticket resolved as Signed. *[trac]* permission_policies = ReadonlySignedTickets,

Re: [Trac] Read only ticket according to custom resolution type

2014-07-29 Thread Jared Bownds
When enabling the plugin I can see it's is being loaded successfully. You said the code below works properly for you? *Trac log* 2014-07-29 15:36:29,284 Trac[loader] DEBUG: Loading file plugin ReadonlySignedTickets from /srv/trac/trac/plugins/ReadonlySignedTickets.py *ReadonlySignedTickets.py*

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread RjOllos
On Sunday, July 27, 2014 10:49:18 PM UTC-7, Peter Suter wrote: On 28.07.2014 01:01, Jared Bownds wrote: Thanks for the feedback, i'm now confident ReadonlySignedTickets.py is enabled as a plugin. I've run a few tests on the code below. I created a user called temp1 that does

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Jared Bownds
I'm receiving the same error. It can be reproduced by navigating to the any ticket *Stack trace:* https://gist.github.com/anonymous/c00aadd7d9a807d8b371 On Sun, Jul 27, 2014 at 11:55 PM, RjOllos rjol...@gmail.com wrote: On Sunday, July 27, 2014 10:49:18 PM UTC-7, Peter Suter wrote: On

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Steffen Hoffmann
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 28.07.2014 08:55, RjOllos wrote: Btw, in vulnerable_tickets.py, should the check be changed?: if 'VULNERABILITY_VIEW' not in perm: - if 'VULNERABILITY_VIEW' not in perm(resource): It depends on the intention. From earlier discussion I

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Peter Suter
On 28.07.2014 08:55, RjOllos wrote: I'm encountering the dreaded issue: RuntimeError: maximum recursion depth exceeded while calling a Python object The issue seems to be with the check: 'TRAC_ADMIN' in perm. Oops, right. I think adding `action == 'TRAC_ADMIN'` to the check (before the

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Peter Suter
Oops, and now I dropped the `if t['resolution'] == 'Signed':` test by mistake.. {{{ from trac.core import * from trac.perm import IPermissionPolicy from trac.ticket.model import Ticket class ReadonlySignedTickets(Component): implements(IPermissionPolicy) def check_permission(self,

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Jared Bownds
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):

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Jared Bownds
Peter, Should this be included, or excluded? For clarity, please provide the entire block of code that should be used to implement the following behavior: - Once a ticket is resolved as 'Signed', the ticket is now read only except by TRAC_ADMIN Next, how do we implement the desired

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Ryan Ollos
On Mon, Jul 28, 2014 at 10:55 AM, Jared Bownds jared.bow...@gmail.com 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

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Ryan Ollos
On Mon, Jul 28, 2014 at 11:26 AM, Jared Bownds jared.bow...@gmail.com wrote: Next, how do we implement the desired error feedback outlined below? - Visually distinguish tickets resolved as 'Signed' by either slightly changing the color of the description body, or add a draft style

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Jared Bownds
Hi Ryan, 2. Add site.html to your Environment templates directory: http://trac.edgewall.org/wiki/TracInterfaceCustomization#SiteAppearance (the first code snippet in that section is what you want to copy to site.html) Response: Is this the code I want to add in *site.html* contained within my

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Jared Bownds
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

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Ryan Ollos
On Mon, Jul 28, 2014 at 1:03 PM, Jared Bownds jared.bow...@gmail.com wrote: Hi Ryan, 2. Add site.html to your Environment templates directory: http://trac.edgewall.org/wiki/TracInterfaceCustomization#SiteAppearance (the first code snippet in that section is what you want to copy to

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Ryan Ollos
On Mon, Jul 28, 2014 at 1:26 PM, Jared Bownds jared.bow...@gmail.com wrote: Hi Ryan, I'm using style.css, and it does show up in the source. The casing of Signed might cause an issue, but probably not. I left out a step: [ticket] decorate_fields = resolution -- You received this message

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Jared Bownds
I left out a step: [ticket] decorate_fields = resolution I added to trac.ini, it's still not working. I'm at a loss as to why it's not working. [ticket] decorate_fields = resolution Here is a snippet from the log 2014-07-28 13:53:09,218 Trac[main] DEBUG: Dispatching RequestWithSession GET

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Jared Bownds
Also, it turns out the this bit of code is not working. I thought it was working, but it turns out the test user (temp1) was not authenticated. Judging by the log, it seems as though everything is working as you would expect, temp1 should not be able to edit the request. However, the update

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Ryan Ollos
On Mon, Jul 28, 2014 at 1:54 PM, Jared Bownds jared.bow...@gmail.com wrote: I left out a step: [ticket] decorate_fields = resolution I added to trac.ini, it's still not working. I'm at a loss as to why it's not working. [ticket] decorate_fields = resolution Here is a snippet from the

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Ryan Ollos
On Mon, Jul 28, 2014 at 2:20 PM, Jared Bownds jared.bow...@gmail.com wrote: I think your onto something, the plugin may not be loading. Has anyone encountered this error before? Also, I opened a ticket regarding the error. http://trac-hacks.org/ticket/11889 *Trac detected an internal

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Jared Bownds
I think your onto something, the plugin may not be loading. Has anyone encountered this error before? Also, I opened a ticket regarding the error. http://trac-hacks.org/ticket/11889 *Trac detected an internal error:* AttributeError: 'datetime.timedelta' object has no attribute

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Jared Bownds
DevayedWiki was causing a problem, thanks for pointing that out - below is my configuration in trac.ini I'm still not sure why it's not working. Do you have any other ideas on what I can check? [components] contextchrome.cors.crossoriginresourcesharingenabler = disabled

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Ryan Ollos
On Mon, Jul 28, 2014 at 3:01 PM, Jared Bownds jared.bow...@gmail.com wrote: DevayedWiki was causing a problem, thanks for pointing that out - below is my configuration in trac.ini I'm still not sure why it's not working. Do you have any other ideas on what I can check? [components]

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Jared Bownds
Is that not the following? Trac[loader] DEBUG: Loading ContextChrome from /srv/trac/trac/plugins/ContextChrome-0.3-py2.6.egg On Mon, Jul 28, 2014 at 3:16 PM, Ryan Ollos rjol...@gmail.com wrote: On Mon, Jul 28, 2014 at 3:01 PM, Jared Bownds jared.bow...@gmail.com wrote: DevayedWiki was

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Ryan Ollos
On Mon, Jul 28, 2014 at 3:42 PM, Jared Bownds jared.bow...@gmail.com wrote: Is that not the following? Trac[loader] DEBUG: Loading ContextChrome from /srv/trac/trac/plugins/ContextChrome-0.3-py2.6.egg That looks good. Does the opening body tag on the ticket page have the class

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Jared Bownds
resolution_is_signedbody class=resolution_is_Signed Taskdiv id=WzTtDiV style=visibility: hidden; position: absolute; overflow: hidden; padding: 0px; width: 1679px; left: -1680px; top: 0px;/div On Mon, Jul 28, 2014 at 3:46 PM, Ryan Ollos rjol...@gmail.com wrote: On Mon, Jul 28, 2014 at 3:42

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Jared Bownds
I found it, it is case sensitive. According the the class name, resolution_is_signedbody class=resolution_is_Signed Taskdiv id=WzTtDiV style=visibility: hidden; position: absolute; overflow: hidden; padding: 0px; width: 1679px; left: -1680px; top: 0px;/div On Mon, Jul 28, 2014 at 3:46 PM,

Re: [Trac] Read only ticket according to custom resolution type

2014-07-28 Thread Jared Bownds
I found it, it is case sensitive. According the the class name, style.css needs to contain: style.css body.resolution_is_*S*igned { background-color: #b3caf5; /* soft blue */ } body tag resolution_is_signedbody class=resolution_is_Signed Taskdiv id=WzTtDiV style=visibility: hidden; position:

Re: [Trac] Read only ticket according to custom resolution type

2014-07-27 Thread 'parvin_she...@yahoo.in' via Trac Users
restore Sent from Yahoo Mail on Android -- 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 trac-users+unsubscr...@googlegroups.com. To post to this group, send email

Re: [Trac] Read only ticket according to custom resolution type

2014-07-27 Thread Peter Suter
Hi On 27.07.2014 01:33, Jared Bownds wrote: * Once a ticket is resolved as 'Signed', the ticket is now read only except to TRAC_ADMIN Custom code for that part might look something like this: {{{ from trac.core import * from trac.perm import IPermissionPolicy from trac.ticket.model

Re: [Trac] Read only ticket according to custom resolution type

2014-07-27 Thread Jared Bownds
Hi Peter, thanks for contributing. Would this bit of code be implemented in perm.py? Any tips you can provide to help me implement this functionality would be greatly appreciated. Best, -Jared On Sunday, July 27, 2014 12:46:04 AM UTC-7, Peter Suter wrote: Hi On 27.07.2014 01:33, Jared

Re: [Trac] Read only ticket according to custom resolution type

2014-07-27 Thread Jared Bownds
I do see how this bit of code matches the requisites for a plugin, however I don't have experience using setup tools to accomplish this task. I do however have setup tools installed. Nevertheless, practical steps would be extremely appreciated! Resources:

Re: [Trac] Read only ticket according to custom resolution type

2014-07-27 Thread Jared Bownds
Okay, I've made some progress, and I want to include that progress so others can come up to speed quicker on the 'basics'. Here is what I have done so far: 1. Create a file called setup.py 2. Create a file called ReadonlySignedTickets.py (contents of both .py files are below) 3.

Re: [Trac] Read only ticket according to custom resolution type

2014-07-27 Thread Peter Suter
On 28.07.2014 01:01, Jared Bownds wrote: Thanks for the feedback, i'm now confident ReadonlySignedTickets.py is enabled as a plugin. I've run a few tests on the code below. I created a user called temp1 that does not have TRAC_ADMIN privileges. Also, I created a request (#1968) and resolved

Re: [Trac] Read only ticket according to custom resolution type

2014-07-26 Thread Olemis Lang
On 7/26/14, Jared Bownds jared.bow...@gmail.com wrote: Reference: http://trac-hacks.org/ticket/11885 I am looking for a solution that will work like this: - Create a new permission group called SIGNER - Add 'signed' as a resolution type - Users with permission SIGNER are allowed

Re: [Trac] Read only ticket according to custom resolution type

2014-07-26 Thread Jared Bownds
From the research I've done so far, there is presently no plugin that offers the permission functionality, or the visual indication according to resolution type i.e. 'SIGNED'. With regards to a custom permission policy, I'd be interested in learning how to implement it to achieve the desired