def _is_my_ticket(user, ticket):
    """Check to see if the user has permission to access
    a ticket. If not then deny access."""
    if user.is_superuser or user.is_staff or user.id == ticket.assigned_to.id:
        return True
    else:
        return False
