#873 closed defect (fixed)
trac-admin will not remove users from permission groups
Reported by: | Owned by: | Christopher Lenz | |
---|---|---|---|
Priority: | normal | Milestone: | 0.8 |
Component: | admin/console | Version: | devel |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
trac-admin allows to add lower case permission, but is not able to delete these permissions again. Looking in the source the first problem seems to be a simple typo.
def _do_permission_add(self, user, action): if not action.islower() and not action.isupper(): print 'group-names must be in lower case and permissions in upper case' return self.db_execsql("INSERT INTO permission VALUES('%s', '%s')" % (user, action))
The term action.islower()
should read user.islower()
.
The second problem is related to the first, since all actions are forced to be upper case. So the question is, wether there should be a sanity check to be able to recover from wrong entries. Right now, the wrong entry can only be removed via direct access to the database.
Attachments (0)
Change History (3)
comment:1 by , 20 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 20 years ago
Summary: | trac-admin adds lower case permissions → trac-admin will not remove users from permission groups |
---|
Updated subject to help avoid dups.
The problem isn't actually that check, but the
_do_permission_remove()
function.Changeset [755] added a simple hack that allows permission groups (see also TracPermissions). You can add users to groups by passing an all-lower-case action to permission add. The check you mentioned actually only verifies that the action is either all lower-case (in which case it's actually a group name) or all upper-case (in that case it's an action).