Edgewall Software

Opened 7 years ago

Last modified 7 years ago

#12837 closed defect

Poor PermissionError message when resource.id is None — at Initial Version

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.2.2
Component: general Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Examples:

  • /timeline: TIMELINE_VIEW privileges are required to perform this operation on timeline:None. You don't have the required permissions.
  • /newticket: TICKET_CREATE privileges are required to perform this operation on Ticket #None. You don't have the required permissions.

Proposed fix:

  • trac/perm.py

    diff --git a/trac/perm.py b/trac/perm.py
    index b309a00f0..6f9405682 100644
    a b class PermissionError(StandardError, TracBaseError):  
    5151        self.resource = resource
    5252        self.env = env
    5353        if self.action:
    54             if self.resource:
     54            if self.resource and self.resource.id:
    5555                msg = _("%(perm)s privileges are required to perform "
    5656                        "this operation on %(resource)s. You don't have the "
    5757                        "required permissions.",

Change History (0)

Note: See TracTickets for help on using tickets.