#2157 closed defect (fixed)
[PATCH] trac-admin should print error on actions with mistyped username
Reported by: | Owned by: | Remy Blank | |
---|---|---|---|
Priority: | normal | Milestone: | 1.0 |
Component: | admin/console | Version: | 0.9b1 |
Severity: | minor | Keywords: | permission, patch |
Cc: | vyt@…, Thijs Triemstra | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
trac-admin permission remove aMonymous WIKI_CREATE
should produce error instead of silent as operation success.
Attachments (1)
Change History (12)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
It can be done by checking known permissions for this actions:
permission add user template_user ("template_user" must exists)[BR] permission remove user permission ("user" must exists)
comment:3 by , 18 years ago
I misunderstood on this on first reading… this is not for an add permission, but for a remove. In this case, Trac does know if the permission exists for a specific user, so it should say "No user with that permission found" or something similar since the remove failed.
comment:4 by , 18 years ago
Keywords: | permission added |
---|---|
Milestone: | → 0.12 |
Severity: | normal → minor |
comment:5 by , 14 years ago
Owner: | removed |
---|
comment:6 by , 14 years ago
Cc: | added |
---|---|
Description: | modified (diff) |
comment:7 by , 14 years ago
Keywords: | patch added |
---|---|
Milestone: | next-major-0.1X → 0.13 |
Summary: | trac-admin should print error on actions with mistyped username → [PATCH] trac-admin should print error on actions with mistyped username |
The attached patch prints the following error for unknown users:
$ trac-admin test-trac permission remove anonymous TICKET_VIEWZ Error: Cannot remove permission TICKET_VIEWZ for username anonymous.
comment:8 by , 14 years ago
Well, I'm not sure we can do that, as it's a feature to be able to add permissions in advance for yet unknown users. For example, immediately after creating a new environment, you want to be able to add TRAC_ADMIN permission for yourself or some admin account.
comment:9 by , 14 years ago
Well, for remove it's probably OK, but the summary was more general than that.
comment:10 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I wanted to apply remove-perm-2157.patch, but _do_remove()
has always been so ugly that I took the opportunity to refactor it and add a few unit tests (and fix this issue). The result is in [10685].
As mentioned in comment:8, we don't want an error for permission add
.
comment:11 by , 14 years ago
Owner: | set to |
---|
How should Trac know that you don't have a user called “aMonymous”. I don't see how we could implement this currently.