Edgewall Software

Opened 8 years ago

Closed 8 years ago

Last modified 4 years ago

#12242 closed enhancement (fixed)

TracAdmin "permission add" command should be atomic — at Version 4

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:

Description

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.

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

Milestone: 1.21.3.1

comment:3 by Ryan J Ollos, 8 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)
Note: See TracTickets for help on using tickets.