id summary reporter owner description type status priority milestone component version severity resolution keywords cc branch changelog apichanges internalchanges 12242 "TracAdmin ""permission add"" command should be atomic" Ryan J Ollos Ryan J Ollos "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." enhancement closed normal 1.3.1 admin/console normal fixed The `trac-admin` `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. `PermissionSystem.grant_permission` raises `PermissionExistsError` rather than `IntegrityError` when the user already has the action or is a member of the group.