관리-도구
편집 파일: model.cpython-311.pyc
� IMgF � �b � d dl mZmZmZ d dlmZmZmZmZm Z d dl mZmZ G d� de� � Z dS )� )� CharField�Check� TextField)�AV� AV_REPORT�FULL�NA� PROACTIVE)�Model�instancec �\ � e Zd ZdZdZ G d� d� � Z ed�� � Z ed e d� ee� � � � ge� � � Z ed e d � eee� � � � ge� � � Zededd fd �� � Zed� � � Zd� Zdedefd�Zdedefd�Zd� ZdS )�FeatureManagementPermszrPermissions state for Feature Management. Each record/instance is a set of permissions of a single user. � c � � e Zd Zej ZdZdS )�FeatureManagementPerms.Meta�feature_management_permissionsN)�__name__� __module__�__qualname__r �db�database�db_table� � �]/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/feature_management/model.py�Metar s � � � � � ��;��3���r r T)�uniqueFzproactive in ('{}','{}'))�null�constraints�defaultzav in ('{}','{}','{}')�user�returnc � � | � � � }|�|S t |j t |j i}| � ||�� � \ }}|S )z� Get feature permissions by user name :param user: user name :return: :class:`FeatureManagementPerms` object for user N)r! �defaults)�get_defaultr �avr � proactive� get_or_create)�clsr! r r$ �perm�_s r �get_permzFeatureManagementPerms.get_perm- sX � � �/�/�#�#���<��N� �� ��w�(� �� �#�#���#�A�A���a��r c �8 � | � | j �� � S )zGet default permissions)r! )�get�DEFAULT)r) s r r% z"FeatureManagementPerms.get_defaultB s � � �w�w�C�K�w�(�(�(r c �"