Jean Marie
There is a plugin on trac-hacks called unixgroups. So if you installed
trac on a unix/linux box you can use it.
I have made a patch for it so it can handle sites that have a centralized
user administration which have many groups. If you want it i can email it
to you.
Regards
--
********************************************************************
* Bas van der Vlies e-mail: ba...@sara.nl *
* SARA - Academic Computing Services Amsterdam, The Netherlands *
********************************************************************
> is it possible to set a user defined group as permision for a ticket
> status instead of using the pre-defined permission TICKET_MODIFY. I
> want only certain user to perferm certain ticket actions.
Maybe http://trac-hacks.org/wiki/BlackMagicTicketTweaksPlugin is what
you are looking for?
I've never tried it.
Rainer
> I want to disallow a group of user to select a certain action for a
> ticket, e.g. a developer is not allowed to close a ticket.
I have a similar issue. A developer must not close a ticket, instead,
once he marked a ticket "resolved", the ticket must go over to the QA
people. They will perform their tests and finally, either close the
ticket or re-assign it to the developer.
This is still not resolved for me (has not prio number 1), but I think
it is doable by changing the default workflow.
Rainer
Correct.
First you need to create new permission, e.g. TICKET_CLOSE.
Then you need to create group in trac what has that permission (or
assign permission to certain users).
Finally use permission property in new trac workflow to enable close
action only for TICKET_CLOSE permission.
like putting (replacing existing) following piece to workflow-section:
resolve = new,assigned,reopened -> closed
resolve.operations = set_resolution
resolve.permissions = TICKET_CLOSE
if you want to create "group" you do it this way in trac-admin (or by
using webadmin):
permission add my_group TICKET_CLOSE
permission add dev1 my_group
permission add dev2 my_group
very simple.
--
Jani Tiainen
"Tein sein mihin näillä lahjoilla pystyin.
Tein sen, en yhtään enempää." - Martti Servo & Napander
Rainer Sokoll kirjoitti:
> On Wed, Oct 08, 2008 at 01:59:48AM -0700, Jean Marie wrote:Correct.
>
>> I want to disallow a group of user to select a certain action for a
>> ticket, e.g. a developer is not allowed to close a ticket.
>
> I have a similar issue. A developer must not close a ticket, instead,
> once he marked a ticket "resolved", the ticket must go over to the QA
> people. They will perform their tests and finally, either close the
> ticket or re-assign it to the developer.
> This is still not resolved for me (has not prio number 1), but I think
> it is doable by changing the default workflow.
First you need to create new permission, e.g. TICKET_CLOSE.
Doesn't that BlackMagicTicketPlugin make possible to create arbitary
permissions for tickets?
Stephen Moretti kirjoitti:
>
>
> 2008/10/8 Jani Tiainen <red...@gmail.com <mailto:red...@gmail.com>>
>Doesn't that BlackMagicTicketPlugin make possible to create arbitary
>
> Rainer Sokoll kirjoitti:
> > On Wed, Oct 08, 2008 at 01:59:48AM -0700, Jean Marie wrote:
> >
> >> I want to disallow a group of user to select a certain action for a
> >> ticket, e.g. a developer is not allowed to close a ticket.
> >
> > I have a similar issue. A developer must not close a ticket, instead,
> > once he marked a ticket "resolved", the ticket must go over to the QA
> > people. They will perform their tests and finally, either close the
> > ticket or re-assign it to the developer.
> > This is still not resolved for me (has not prio number 1), but I
> think
> > it is doable by changing the default workflow.
>
> Correct.
>
> First you need to create new permission, e.g. TICKET_CLOSE.
>
>
> And to create your own permissions :
> http://nil.checksite.co.uk/post.cfm/trac-0-11-creating-your-own-permissions
permissions for tickets?
Side note: Does it really enforce permissions or does it rather make
fields un-editable via Genshi transformations? This is not the same.
- Thomas
-------------------------------------------
I stopped our apache2 driver.
I added a mypermissions.py into our <track environment>/plugins
directory, here is the contents:
# mypermissions.py
#
# Use to add other permissions.
#
# Using to add a TICKET_CLOSE permission.
#
# Drop this file in the plugins directory, restart the server,
# and the permission(s) should be available. According to
# what I have found in the Trac Users group under Google groups.
from trac.core import Component, implements
from trac.perm import IPermissionRequestor
class MyPermissions(Component):
implements(IPermissionRequestor)
def get_permission_actions(self):
# return ('MY_FIRST_PERM', 'MY_SECOND_PERM')
return ('TICKET_CLOSE')
-------------------------------------
I modified the trac.ini [components] and [ticket-workflow]; here are
the diffs:
> diff trac.ini trac_TICKET_CLOSE.ini
34a35
> mypermissions.* = enabled
181c182
< close.permissions = TICKET_ADMIN
---
> close.permissions = TICKET_CLOSE
186c187
< close_new.permissions = TICKET_ADMIN
---
> close_new.permissions = TICKET_CLOSE
-----------------------------------------
I restarted apache2 and things did not work.
I got an "Oops... " when trying to view an issue that said, "Trac
detected an internal error: IndexError: string index out of range"
The trac.log file had this added after attempting to view the issue:
2009-02-13 07:23:27,291 Trac[main] ERROR: string index out of range
Traceback (most recent call last):
File "/usr/local/lib64/python2.5/site-packages/Trac-0.11.2-py2.5.egg/
trac/web/main.py", line 432, in _dispatch_request
dispatcher.dispatch(req)
File "/usr/local/lib64/python2.5/site-packages/Trac-0.11.2-py2.5.egg/
trac/web/main.py", line 204, in dispatch
resp = chosen_handler.process_request(req)
File "/usr/local/lib64/python2.5/site-packages/Trac-0.11.2-py2.5.egg/
trac/ticket/web_ui.py", line 181, in process_request
return self._process_ticket_request(req)
File "/usr/local/lib64/python2.5/site-packages/Trac-0.11.2-py2.5.egg/
trac/ticket/web_ui.py", line 530, in _process_ticket_request
get_reporter_id(req, 'author'), field_changes)
File "/usr/local/lib64/python2.5/site-packages/Trac-0.11.2-py2.5.egg/
trac/ticket/web_ui.py", line 1168, in _insert_ticket_data
fields = self._prepare_fields(req, ticket)
File "/usr/local/lib64/python2.5/site-packages/Trac-0.11.2-py2.5.egg/
trac/ticket/web_ui.py", line 1080, in _prepare_fields
TicketSystem(self.env).eventually_restrict_owner(field, ticket)
File "/usr/local/lib64/python2.5/site-packages/Trac-0.11.2-py2.5.egg/
trac/ticket/api.py", line 320, in eventually_restrict_owner
.get_users_with_permission('TICKET_MODIFY'):
File "/usr/local/lib64/python2.5/site-packages/Trac-0.11.2-py2.5.egg/
trac/perm.py", line 384, in get_users_with_permission
for child in action[1]:
IndexError: string index out of range
---------------------------------
When I used Trac / Admin / Permission and looked at the permission
selections, I saw things like:
BROWSER_VIEW
C
C
CHANGESET_VIEW
CONFIG_FILE
E
E
EMIAL_VIEW
FILE_VIEW
I
K
L
LOG_VIEW
and it goes on
---------------------------------------
I quickly stopped apache2, restored the trac.ini to what it had been,
and removed mypermissions.py and .pyc files from the plugin directory
and restarted apache2.
I do not understand what the mypermissions.py file is doing.
What am I missing or doing wrong? Is the mypermissions.py script
correct? Is my entry in the script for 'TICKET_CLOSE' correct? Do I
need brackets instead of parens since I am only adding one value?
Thanks in advance.
On Oct 8 2008, 7:36 am, yoh...@gmail.com wrote:
> On Oct 8, 7:19 am, Jean Marie <jeanmari...@gmx.net> wrote:
>
> > > > First you need to create new permission, e.g. TICKET_CLOSE.
>
> > > How can i do this?
>
> > I found an intermediate solution by "hacking" the database:
>
> > INSERT INTO permission (username, action) VALUES ("group_qa",
> > "TICKET_CLOSE");
>
> > After this, the manuall added permissions assignment is visible in the
> > admin section and also the trac-admin shows me this assignment.
>
> > In trac.ini i've set:
> > [ticket-workflow]
> > close.permissions = TICKET_CLOSE
>
> > Now only users that are members of group "group_qa" are able to close
> > a ticket.
>
> > For the moment this solution is fine by me. Are there any doubts about
> > this solution?
>
> > Maybe there'll be a more elegant way of adding user defined
> > permissions.
>
> > Best regards
> > Jean Marie
>
> AHH, bad idea.
>
> stated about 3 responses up :
>
> >And to create your own permissions :
> >http://nil.checksite.co.uk/post.cfm/trac-0-11-creating-your-own-permi...
>
> again, note his code isn't formatted properly for python on that web
> site.
>
> in this thread:http://groups.google.com/group/trac-users/browse_thread/thread/79b118...
I found my problem. I need brackets instead of the parens in
mypermissions.py