Graybyt3 Was Here
Linux cloud.locucionar.com 3.10.0-1160.81.1.el7.x86_64 #1 SMP Fri Dec 16 17:29:43 UTC 2022 x86_64
Apache
91.191.211.241
/
opt
/
imunify360
/
venv
/
lib64
/
python3.11
/
site-packages
/
defence360agent
/
feature_management
/
__pycache__
[ HOME ]
Exec
Submit
checkers.cpython-311.pyc
� k�nh� � � � d dl mZ d dlmZ ddlmZ ddlmZ ddlm Z de dee d e fd �Zdde d e de fd �Zdde d e de fd�Zde d e fd�ZdS )� )�List)�deepcopy� )�FeatureDisabledError)�CONFIG_MAPPINGS)�FeatureManagementPerms�feature�permissions�userc � � |�dS t j |� � }|� | � � }||vr$t d� | |�� � � � �dS )a Raise exception if feature is disabled for user :param feature: feature name :param permissions: permissions required :param user: user name :return: None :raises FeatureDisabledError: if user is prohibited from use of the feature Nz.Feature '{name}' is disabled for user '{user}')�namer )r �get_perm�get_featurer �format)r r r �perm�permission_values �`/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/feature_management/checkers.py� check_featurer su � � �|���!�*�4�0�0�D��'�'��0�0���{�*�*�"�<�C�C��4� D� � � � � � +�*� F�sectionc � � |�dS | t vrdS |t | vrdS t | t | | |� � n# t $ r |r� Y dS w xY wdS )at Check if section is allowed to be read or write by user :param feature: feature name :param user: user name :param section: section name to check :param raise_: True to raise exception, otherwise return True or False :return: True if config sections is allowed to user, False otherwise :raises FeatureDisabledError: raised if raise_=True NTF)r r r )r r r �raise_s r �check_configr "