Edgewall Software

Opened 8 years ago

Closed 7 years ago

Last modified 4 years ago

#12242 closed enhancement (fixed)

TracAdmin "permission add" command should be atomic

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.3.1
Component: admin/console Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:

The TracAdmin permission add command is atomic when operating on a list of permissions. If the user already possesses one of the permissions, a warning will be printed and the other permissions in the list will be granted. If one of the permissions raises a TracError (e.g. not a valid action), none of the permissions in the list are granted.

API Changes:

PermissionSystem.grant_permission raises PermissionExistsError rather than IntegrityError when the user already has the action or is a member of the group.

Internal Changes:


The following issue was noted in #12226. In the command permission add user1 A B C, if the user already possesses permission B but not A or C, A will be granted but C will not be. Ideally, both permissions A and C would be granted and a message would be printed to indicate that the user already possesses permission B.

Two fixes have been proposed in comment:7:ticket:12226. I'd like to spend some time to understand why the issue is only seen with MySQL before committing a fix.

Attachments (0)

Change History (4)

comment:1 by Ryan J Ollos, 8 years ago

Changes first proposed in #12226 can be found in log:rjollos.git:t12242_atomic_permission_add. I'll make additional revisions soon.

comment:2 by Ryan J Ollos, 8 years ago


comment:3 by Ryan J Ollos, 7 years ago

API Changes: modified (diff)
Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed to trunk in r15094. The changes include comment:5:ticket:12226 and comment:7:ticket:12226.

comment:4 by Ryan J Ollos, 4 years ago

Release Notes: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.