Modify

Opened 4 years ago

Closed 3 years ago

#7145 closed defect (invalid)

PrivateTicketsPlugin is case sensitive for username

Reported by: srl@… Owned by: coderanger
Priority: normal Component: PrivateTicketsPlugin
Severity: major Keywords:
Cc: Trac Release: 0.11

Description

We use e-mail addresses as usernames. It seems that the plugin is case sensitive, so if the owner name is 'Mark@…' but they authenticate as 'mark@…', this plugin won't let them see the ticket.

I think the plugin should be case insensitive.

Attachments (1)

7145case.patch (1.2 KB) - added by srl@… 4 years ago.
7145case.patch - works for me

Download all attachments as: .zip

Change History (4)

Changed 4 years ago by srl@…

7145case.patch - works for me

comment:1 Changed 4 years ago by srl@…

not sure the patch attached properly.

Index: 0.11/privatetickets/policy.py
===================================================================
--- 0.11/privatetickets/policy.py	(revision 7874)
+++ 0.11/privatetickets/policy.py	(working copy)
@@ -63,17 +63,17 @@
         
         if perm.has_permission('TICKET_VIEW_REPORTER'):
             had_any = True
-            if tkt['reporter'] == perm.username:
+            if tkt['reporter'].lower() == perm.username.lower():
                 return None
         
         if perm.has_permission('TICKET_VIEW_CC'):
             had_any = True
-            if perm.username in [x.strip() for x in tkt['cc'].split(',')]:
+            if perm.username.lower() in [x.strip().lower() for x in tkt['cc'].split(',')]:
                 return None
         
         if perm.has_permission('TICKET_VIEW_OWNER'):
             had_any = True
-            if perm.username == tkt['owner']:
+            if perm.username.lower() == tkt['owner'].lower():
                 return None
         
         if perm.has_permission('TICKET_VIEW_REPORTER_GROUP'):
@@ -126,4 +126,5 @@
                     groups.add(action)
                     repeat = True 
         
-        return groups
\ No newline at end of file
+        return groups
+

comment:2 Changed 4 years ago by rjollos

  • Summary changed from PrivateTicketsPlugin is case sensitive to PrivateTicketsPlugin is case sensitive for username

Case-sensitivity should be an option for the plugin.

comment:3 Changed 3 years ago by rjollos

  • Resolution set to invalid
  • Status changed from new to closed

There is a Trac option ignore_auth_case (in the [trac] section of trac.ini). By default it is false. It appears that your authentication mechanism is case insensitive, but Trac is set to be case sensitive.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.