Edgewall Software
Modify

Opened 19 years ago

Closed 14 years ago

Last modified 14 years ago

#2157 closed defect (fixed)

[PATCH] trac-admin should print error on actions with mistyped username

Reported by: vyt@… 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 Thijs Triemstra)

trac-admin permission remove aMonymous WIKI_CREATE

should produce error instead of silent as operation success.

Attachments (1)

remove-perm-2157.patch (1.2 KB ) - added by Thijs Triemstra 14 years ago.
against 0.13 trunk r10664

Download all attachments as: .zip

Change History (12)

comment:1 by Christopher Lenz, 19 years ago

How should Trac know that you don't have a user called “aMonymous”. I don't see how we could implement this currently.

comment:2 by vyt@…, 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 sid, 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 Christian Boos, 18 years ago

Keywords: permission added
Milestone: 0.12
Severity: normalminor

comment:5 by Remy Blank, 14 years ago

Owner: daniel removed

comment:6 by Thijs Triemstra, 14 years ago

Cc: Thijs Triemstra added
Description: modified (diff)

by Thijs Triemstra, 14 years ago

Attachment: remove-perm-2157.patch added

against 0.13 trunk r10664

comment:7 by Thijs Triemstra, 14 years ago

Keywords: patch added
Milestone: next-major-0.1X0.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 Christian Boos, 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 Christian Boos, 14 years ago

Well, for remove it's probably OK, but the summary was more general than that.

comment:10 by Remy Blank, 14 years ago

Resolution: fixed
Status: newclosed

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 Remy Blank, 14 years ago

Owner: set to Remy Blank

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Remy Blank.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Remy Blank 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.