Adding custom permission to TRAC

4 views
Skip to first unread message

Hare

unread,
Sep 5, 2008, 11:47:22 AM9/5/08
to Trac Users
Hi,

Is there way that I can add a custom permission this is to restrict
some of the workflow transitions. I had seen some of the previous
posts and it was asked to refer BlackMagicTicketTweaks. But I am not
able to find the same.
Thanks in advance for any pointers..

--hare

Jerry Brown

unread,
Sep 11, 2008, 4:39:10 PM9/11/08
to Trac Users
Its at Trac-Hacks (track-hacks.com).

Jeff Hammel

unread,
Sep 11, 2008, 4:52:31 PM9/11/08
to trac-...@googlegroups.com

yoh...@gmail.com

unread,
Sep 12, 2008, 12:51:47 PM9/12/08
to Trac Users
On Sep 11, 3:52 pm, Jeff Hammel <jham...@openplans.org> wrote:
> Actually, its at trac-hacks.org:
>
> http://trac-hacks.org/wiki/BlackMagicTicketTweaksPlugin
>
> Jeff Hammel
> The Open Planning Projecthttp://topp.openplans.org
>
> On Thu, Sep 11, 2008 at 01:39:10PM -0700, Jerry Brown wrote:
>
> > Its at Trac-Hacks (track-hacks.com).
>
> > On Sep 5, 10:47 am, Hare <harsha...@gmail.com> wrote:
> > > Hi,
>
> > > Is there way that I can add a custom permission this is to restrict
> > > some of the workflow transitions. I had seen some of the previous
> > > posts and it was asked to refer BlackMagicTicketTweaks. But I am not
> > > able to find the same.
> > > Thanks in advance for any pointers..
>
> > > --hare

I lost the thread/link, but someone recently posted something about
how to write you're very own plugin, that all it did was implement
custom permissions. It consisted of the following:
<pre>
from trac.core import Component, implements
from trac.perm import IPermissionRequestor

class MyPermissions(Component):
implements(IPermissionRequestor)

def get_permission_actions(self):
return (&#39;MY_FIRST_PERM&#39;, &#39;MY_SECOND_PERM&#39;)
</pre>

with MY_FIRST_PERM, MY_SECOND_PERM as some new permissions added in
this case
you then added the MyPermissions handler to your permission handler
list in config.

not sure if that is what you are after.

Sriharsha Bheemaraju

unread,
Sep 13, 2008, 4:15:24 AM9/13/08
to trac-...@googlegroups.com
Thanks a lot for the response, it really helps...
Reply all
Reply to author
Forward
0 new messages