# -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2017-2019 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later

from .settings import SITE_NAME


def context_user(request):
    user = request.user
    is_perm = user.has_perms(['perm'])
    is_bureau = user.has_perms(['bureau'])
    return {
        'is_perm': is_perm,
        'is_bureau': is_bureau,
        'request_user': user,
        'site_name': SITE_NAME,
    }
