Files @ e726ff21a8ff
Branch filter:

Location: symposion_app/vendor/symposion/reviews/utils.py

James Polley
Create regidesk app

Shows summary of all attendees with a paid ticket, including
boarding_pass status.

Currently, regidesk allows staff with the requisite permission the
ability to view the checkin status of attendees, and email the user
their boarding pass email.

Included is a view for the user to retrieve their own QR code (in case
they got the plain-text version of the email, they can use this to
download an image to their phone for faster checkin)
def has_permission(user, proposal, speaker=False, reviewer=False):
    """
    Returns whether or not ther user has permission to review this proposal,
    with the specified requirements.

    If ``speaker`` is ``True`` then the user can be one of the speakers for the
    proposal.  If ``reviewer`` is ``True`` the speaker can be a part of the
    reviewer group.
    """
    if user.is_superuser:
        return True
    if speaker:
        if user == proposal.speaker.user or \
           proposal.additional_speakers.filter(user=user).exists():
            return True
    if reviewer:
        if user.groups.filter(name="reviewers").exists():
            return True
    return False