gFdZddlZddlmZmZddlmZddlmZddl m Z m Z m Z ej eZdZedZGdd Zd efd Zedd ZeddZdS)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 . Copyright © 2019 Cloud Linux Software Inc. This software is also available under ImunifyAV commercial license, see N)ModelSqliteDatabase)FULL)skip_for_im360)find_revisium_dbget_all_domainsget_permission_statusra_cleanup_allowedc0eZdZUeed<edZdS)dbFeatureManagementPermissionsc*|jd|_dS)Nfeature_management_permissions)ormr )clsmigrators a/opt/imunify360/venv/lib/python3.11/site-packages/imav/migrations/008_subscription_permissions.pyinitzdb.init,s+3< ,, (((N)__name__ __module__ __qualname__r__annotations__ classmethodrrrr r )s;"''''  [   rr returnc i} t}n4#t$r'}td||cYd}~Sd}~wwxYw|D]}|dx} t |dt}nS#t$rF}tdt|dt|Yd}~d}~wwxYw|||<|S)z1 {"user123": False, "user345": True, ..} zFailed to get Plesk domains: %rNowneridz8Failed to get permission status for domain: %s Error: %sname) r Exceptionloggerwarningvaluesgetr CLEANUP_ALLOWED_PERM_NAMEstr)user_imav_cleanup_perm all_domainse domain_inforimav_cleanup_alloweds rget_imav_permission_mapr-3s7 &%'' &&&8!<<<%%%%%%%&#))++==  __W-- -E 6  #8D!#<$$     NNJK'((A    HHHH  )=u%% !!s/ A?AA6B C"Ss ')) EFFF577  D FF       @AAAGGH/5577& !>LL M   M1 %#'  ""$$$    NNNA    HHHH  s0A A> (A99A>AD E#)EEc dS)Nr)rr5r6r7s rrollbackr@}sDr)F)__doc__loggingpeeweerr,defence360agent.feature_management.constantsrimav.migration_utils.otherrimav.migration_utils.revisiumrrr getLoggerrr"r&rar dictr-r>r@rrrrJs@*((((((((======555555  8 $ $0^D        """""@&&&&R      r