OwlCyberSecurity - MANAGER
Edit File: 008_subscription_permissions.cpython-311.pyc
� ����N�6h+ �����������������������������d�Z�ddlZddlmZmZ�ddlmZ�ddlmZ�ddl m Z mZ��ej��������e ������������Z�ed������������Z�G�d��d������������Zd efd �Zedd���������������Zedd ���������������ZdS�)u �� This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. Copyright © 2019 Cloud Linux Software Inc. This software is also available under ImunifyAV commercial license, see <https://www.imunify360.com/legal/eula> �����N)�Model�SqliteDatabase)�FULL)�skip_for_im360)�find_revisium_db�get_all_domainsc��������������������0�����e�Zd�ZU�eed<���ed����������������ZdS�)�db�FeatureManagementPermissionsc������������������*�����|j���������d���������|�_��������d�S�)N�feature_management_permissions)�ormr���)�cls�migrators��� �a/opt/imunify360/venv/lib/python3.11/site-packages/imav/migrations/008_subscription_permissions.py�initzdb.init&���s������+3�<�,�, ��(�(�(�����N)�__name__� __module__�__qualname__r����__annotations__�classmethodr�����r���r���r ���r ���#���s;����������������"'�'�'�'�� �� ���[� �� �� r���r ����returnc�������������������,����i�}� �t������������������������}n4#�t����������$�r'}t�������������������������������d|�������������|�cY�d}~S�d}~ww�xY�w|�����������������������������������D�]8}|���������������������d������������x}��|���������������������d������������x} ���3||�|<����9|�S�)z1 {"user123": False, "user345": True, ..} zFailed to get Plesk domains: %rN�owner�imav_cleanup_allowed)r���� Exception�logger�warning�values�get)�user_imav_cleanup_perm�all_domains�e�domain_infor���r���s��� r����get_imav_permission_mapr'���-���s�������� ��&�%�'�'������&��&��&����8�!�<�<�<�%�%�%�%�%�%�%�����&�����#�)�)�+�+�� =�� =�� �_�_�W�-�-�-�E�6�� �$/�O�O�4J�$K�$K�K� � ��� �(<��u�%�%�!�!s������ A�?�A�AFc����������� �����������|rd�S�t������������������������}|�t�������������������������������d�������������d�S� �t������������������������}n@#�t����������$�r3}t�������������������������������dt ����������|�������������������������Y�d�}~d�S�d�}~ww�xY�w|st�������������������������������d�������������d�S�t�������������������������������|��������������|� ����������������������������������D�]�\��}} �t����������j �����������������������������|�������������\��} } |r t����������| _ ��������| �������������������������������������L#�t����������$�r3}t�������������������������������d|t ����������|�������������������������Y�d�}~��d�}~ww�xY�wd�S�)Nz/No legacy ImunifyAV database found. Skipping...z6Cannot obtain permissions map for migration, Error: %sz*No users to migrate AV cleanup permissions)�userz<Failed to update feature permissions for user: %s, Error: %s)r���r����infor'���r���r ����strr ���r����itemsr���� get_or_creater����av�save)r����database�fake�kwargs�revisium_db_path�imav_permission_mapr%����username�status� feature_perms�_s��� r����migrater9���G���s�����������'�)�)�������E�F�F�F����5�7�7��������������D���F�F� �� �� �� ���������������������@�A�A�A����G�G�H����/�5�5�7�7�������&� �!�>�L�L��� M�� �� ��M�1���� %�#'� � ��"�"�$�$�$����� �� �� ��N�N�N���A��� �� �� � � �H�H�H�H����� ������s0����A�� A>�(A9�9A>�AD� E�#)E�Ec�����������������������d�S�)Nr���)r���r0���r1���r2���s��� r����rollbackr;���q���s�������Dr���)F)�__doc__�logging�peeweer���r����,defence360agent.feature_management.constantsr����imav.migration_utils.otherr����imav.migration_utils.revisiumr���r���� getLoggerr���r����rar ����dictr'���r9���r;���r���r���r����<module>rE������s�������*������(��(��(��(��(��(��(��(��=��=��=��=��=��=��5��5��5��5��5��5��K��K��K��K��K��K��K��K� �� �8� $� $���^�D���� �� �� �� �� �� �� �� �"���"��"��"��"�4��&��&��&����&�R�� �� �� ���� �� �� r���