o
    Žèdi°  ã                   @   sF   d dl mZ G dd„ dejƒZG dd„ dejƒZG dd„ dejƒZdS )	é    )Úpermissionsc                   @   s   e Zd Zdd„ ZdS )ÚIsAdminToAllowCRUDc                 C   ó$   |j dkrdS |jo|jjo|jjS )NÚGETT©ÚmethodÚuserÚis_authenticatedÚis_superuser©ÚselfÚrequestÚview© r   úK/var/www/html/evchargy.com/django-station-ev/station_ev/base/permissions.pyÚhas_permission   ó   
ÿz!IsAdminToAllowCRUD.has_permissionN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r      s    r   c                   @   ó   e Zd ZdZdd„ ZdS )ÚAdminOrPostOnlyPermissionzb
    Custom permission to allow admins to perform any action and normal users only to create.
    c                 C   r   )NÚPOSTTr   r   r   r   r   r      r   z(AdminOrPostOnlyPermission.has_permissionN©r   r   r   Ú__doc__r   r   r   r   r   r      ó    r   c                   @   r   )ÚAdminOrPostDeleteOnlyPermissionzu
    Custom permission to allow admins to perform any action and normal users only to create, update and delete.
    c                 C   s$   |j dv rdS |jo|jjo|jjS )N)r   ÚDELETETr   r   r   r   r   r   %   r   z.AdminOrPostDeleteOnlyPermission.has_permissionNr   r   r   r   r   r       r   r   N)Úrest_frameworkr   ÚBasePermissionr   r   r   r   r   r   r   Ú<module>   s    