Edgewall Software
Modify

Opened 15 years ago

Closed 15 years ago

#9279 closed defect (fixed)

trac-admin will create but rejects user assign to mixed case permission groups (works in WebAdmin)

Reported by: py.hieroglyph@… Owned by: Remy Blank
Priority: normal Milestone: 0.12
Component: admin/console Version: 0.11.7
Severity: normal Keywords: review permissions
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

How to Reproduce:

  • both WebAdmin and trac-admin allow you to create groups named e.g. gPigs and gChickens
  • WebAdmin allows you to assign users to such groups
  • trac-admin <env> permission add <user> gChickens fails with the message Group names must be in lower case and actions in upper case

This is inconsistent between the two methods and against the documentation (e.g. TracPermissions#PermissionGroups). I will add excerpts of the discussion from the users list in the comments.

System Information:

Trac: 0.11.7
Python: 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)]
setuptools: 0.6c11
psycopg2: 2.0.13
Genshi: 0.5.1
mod_wsgi: 3.0 (WSGIProcessGroup WSGIApplicationGroup %{GLOBAL})
Subversion: 1.6.6 (r40053)
jQuery: 1.2.6
OS Windows Server 2008

Using the serach terms "trac-admin permission group" returned only 18 tickets of which only the following seemed relevant: #666, #873 and #2146, none of which are duplicates. Using "permission groups webadmin" returned 3 with none relevant.

Attachments (0)

Change History (7)

comment:1 by py.hieroglyph@…, 15 years ago

Added from users list:

From: trac-users@… On Behalf Of Remy Blank Sent: 26 April 2010 18:57

I can confirm this behavior on current trunk. Permissions must be all-uppercase and groups all-lowercase. The code checks for either .isupper() or .islower() to be true for all arguments to "permission add".

The admin panel only checks that neither users nor groups are all-uppercase. No other checks are done.

I guess the inconsistency counts as a bug, so you may want to open a ticket for that (make sure you search for duplicates first). I don't know which behavior is correct, though.

— Remy

comment:2 by py.hieroglyph@…, 15 years ago

Added from users list:

From: trac-users@… On Behalf Of Hal
Sent: 28 April 2010 15:46

The "principle of least surprise" suggests the admin panel behavior is correct, and the bug is in trac-admin.

If the admin panel is changed, many existing installations will break (it's a restriction of rules). If trac-admin is changed, no existing installations break (it's a relaxation of rules).

—Hal

comment:3 by Remy Blank, 15 years ago

Milestone: 0.12.1
Owner: set to Remy Blank

The documentation is a bit ambiguous:

Use lowercase for group names, as uppercase is reserved for permissions.

Does this mean "use all-lowercase for group names", or "use at least some lowercase for group names"? trac-admin permission add enforces the former, and the admin panel the latter.

Personally, I'm in favor of the latter. What say ye?

comment:4 by Christian Boos, 15 years ago

I'm fine with the latter as well.

Doc could be:

Use at least one lowercase character in group names, as all uppercase is reserved for permissions

in reply to:  4 comment:5 by Mikael Relbe, 15 years ago

Replying to cboos:

Doc could be:

Use at least one lowercase character in group names, as all uppercase is reserved for permissions

I vote for that too.

comment:6 by Remy Blank, 15 years ago

Milestone: 0.12.10.12

Fixed in [9593] (no change in the translations, as the same error message was used as the admin panel).

comment:7 by Remy Blank, 15 years ago

Resolution: fixed
Status: newclosed

And documentation updated in TracPermissions@71.

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.