o
    ÖvÿhÓ  ã                   @   s    d dl mZ G dd„ deƒZdS )é    )ÚBasePermissionc                   @   s   e Zd Zi Zdd„ ZdS )ÚMethodRolePermissionc                 C   sN   t |dd ƒ}|rt |ddƒsdS |j ¡ }t |di ƒ |g ¡}t |dd ƒ|v S )NÚuserÚis_authenticatedFÚallowed_rolesÚrole)ÚgetattrÚmethodÚupperÚget)ÚselfÚrequestÚviewr   r	   Úroles© r   úD/var/www/html/Moveonwheels/move_on_wheels/accessories/permissions.pyÚhas_permission   s   
z#MethodRolePermission.has_permissionN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r      s    r   N)Úrest_framework.permissionsr   r   r   r   r   r   Ú<module>   s    