mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
ldap/permissions: add a migration to delete the legacy xmpp.main perm
This commit is contained in:
parent
cff89050df
commit
2e59393943
1 changed files with 32 additions and 0 deletions
32
src/migrations/0028_delete_legacy_xmpp_permission.py
Normal file
32
src/migrations/0028_delete_legacy_xmpp_permission.py
Normal file
|
@ -0,0 +1,32 @@
|
|||
from logging import getLogger
|
||||
|
||||
from yunohost.tools import Migration
|
||||
|
||||
logger = getLogger("yunohost.migration")
|
||||
|
||||
###################################################
|
||||
# Tools used also for restoration
|
||||
###################################################
|
||||
|
||||
|
||||
class MyMigration(Migration):
|
||||
"""
|
||||
Delete legacy XMPP permission
|
||||
"""
|
||||
|
||||
introduced_in_version = "12.0"
|
||||
dependencies = []
|
||||
|
||||
ldap_migration_started = False
|
||||
|
||||
@Migration.ldap_migration
|
||||
def run(self, *args):
|
||||
from yunohost.permission import user_permission_list, permission_delete
|
||||
|
||||
self.ldap_migration_started = True
|
||||
|
||||
if "xmpp.main" in user_permission_list()["permissions"]:
|
||||
permission_delete("xmpp.main", force=True)
|
||||
|
||||
def run_after_system_restore(self):
|
||||
self.run()
|
Loading…
Add table
Reference in a new issue