Changeset 9569


Ignore:
Timestamp:
Dec 3, 2010, 11:01:56 PM (14 years ago)
Author:
Ryan J Ollos
Message:

Verify permission with req.perm.has_permission since it correctly passes the PermissionCache object to check_permission. This fixes an error that occurred when using the PrivateTicketsPlugin because the check_permission method in that plugin doesn't check that the expected PermissionCache object might be a NoneType. Fixes #5825, #5826.

Location:
trachoursplugin
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trachoursplugin

    • Property svn:ignore set to
      .project

      .pydevproject
  • trachoursplugin/0.11

    • Property svn:ignore set to
      *.egg-info
  • trachoursplugin/0.11/trachours/ticket.py

    r7113 r9569  
    4141        """add hours through comments"""
    4242
    43         # only allow allowed users to add hours via comments
    44         user = req.authname
    45         can_add_hours = PermissionSystem(self.env).check_permission('TICKET_ADD_HOURS', user)
    46         if not can_add_hours:
     43        if not req.perm.has_permission('TICKET_ADD_HOURS'):
    4744            return []
    4845
  • trachoursplugin/0.12

    • Property svn:ignore set to
      *.egg-info
  • trachoursplugin/0.12/trachours/ticket.py

    r7113 r9569  
    4141        """add hours through comments"""
    4242
    43         # only allow allowed users to add hours via comments
    44         user = req.authname
    45         can_add_hours = PermissionSystem(self.env).check_permission('TICKET_ADD_HOURS', user)
    46         if not can_add_hours:
     43        if not req.perm.has_permission('TICKET_ADD_HOURS'):
    4744            return []
    4845
Note: See TracChangeset for help on using the changeset viewer.