Modify

Opened 9 months ago

Closed 9 months ago

Last modified 9 months ago

#13940 closed defect (fixed)

[Patch] $USER substitutions don't works in matching_condition

Reported by: Andrew G. Khodotov Owned by: Cauly
Priority: normal Component: TracConfigurablePermissionPlugin
Severity: normal Keywords: patch
Cc: Trac Release: 1.2

Description (last modified by Andrew G. Khodotov)

Substitution $USER not replaced with real user name.

See attached patch to solve this problem.

Attachments (1)

configurable_permission_$USER.patch (735 bytes) - added by Andrew G. Khodotov 9 months ago.

Download all attachments as: .zip

Change History (6)

Changed 9 months ago by Andrew G. Khodotov

comment:1 Changed 9 months ago by Andrew G. Khodotov

Description: modified (diff)

comment:2 Changed 9 months ago by Cauly

I think the example 3 in wiki is wrong, however is owner_edit_only = ticket, TICKET_EDIT, owner=$USER, *, allow-only working as expected?

By the way, what's the meaning of authname=username?

comment:3 in reply to:  2 ; Changed 9 months ago by Andrew G. Khodotov

Replying to Cauly:

I think the example 3 in wiki is wrong, however is owner_edit_only = ticket, TICKET_EDIT, owner=$USER, *, allow-only working as expected?

No, of course. I wrote remark about this in wiki.


By the way, what's the meaning of authname=username?

The plugin uses Query from trac.ticket.query to check the ticket for matching_condition. Declaration of execute function is

execute(self, req=None, cached_ids=None, authname=None, tzinfo=None, href=None, locale=None)

Function count which I use in my patch has some declaration. So, I transmit into query username which is testing for permission.

Last edited 9 months ago by Andrew G. Khodotov (previous) (diff)

comment:4 in reply to:  3 Changed 9 months ago by Cauly

Resolution: fixed
Status: newclosed

You are right, query needs authname to perfrom $USER substitution. I have applied your patch and updated the wiki. Thank you very much!

comment:5 Changed 9 months ago by Andrew G. Khodotov

Thank YOU for plugin! Simple implementation, ample opportunities - it's great!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Cauly.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.