File: //home/arjun/projects/env/lib/python3.10/site-packages/__pycache__/flask_bouncer.cpython-310.pyc
o
��!^� � @ s� d dl mZ d dlmZmZmZmZ d dlm Z d dl
mZ d dlm
Z
d dlT e dd� �Zd d
� Zdd� ZeZG d
d� de�Zdd� Zdd� ZG dd� de�ZdS )� ��wraps)�request�g�current_app�_app_ctx_stack)�
LocalProxy)� Forbidden)�Ability)�*c C s
t jd S )N�bouncer)r �
extensions� r r �F/home/arjun/projects/env/lib/python3.10/site-packages/flask_bouncer.py�<lambda>
s
r c C sN dt _t�� }t|�}t�� |_tj|_|� | |�r%d�
|| |�}t|��d S )NTz#{0} does not have {1} access to {2})r �_authorized�_bouncer�get_current_userr
�get_authorization_method�authorization_method�
alias_actions�aliased_actions�cannot�formatr )�action�subject�current_user�ability�msgr r r �ensure s
�r c C s4 dt _t�� }t|�}t�� |_tj|_|� | |�S �NT)
r r r r r
r r r r �can)r r r r r r r r! s
r! c @ s e Zd Zdd� Zdd� ZdS )� Conditionc C s || _ || _d S �N�r r )�selfr r r r r �__init__* s
zCondition.__init__c C s t | j| j� d S r# )r r r �r% r r r �test. s zCondition.testN)�__name__�
__module__�__qualname__r&