django_rbac: remove unused code (#70894)

This commit is contained in:
Valentin Deniaud 2022-11-03 13:41:03 +01:00
parent ba71c350b4
commit 14e25ac186
4 changed files with 0 additions and 25 deletions

View File

@ -1,4 +0,0 @@
RBAC_OU_MODEL_SETTING = 'RBAC_OU_MODEL'
RBAC_ROLE_MODEL_SETTING = 'RBAC_ROLE_MODEL'
RBAC_ROLE_PARENTING_MODEL_SETTING = 'RBAC_ROLE_PARENTING_MODEL'
RBAC_PERMISSION_MODEL_SETTING = 'RBAC_PERMISSION_MODEL'

View File

@ -1,21 +0,0 @@
from django.core.management.base import BaseCommand
class Command(BaseCommand):
args = '<clean_threshold>'
help = '''Clean dead permissions and roles'''
def handle(self, *args, **options):
from django_rbac.utils import get_permission_model, get_role_model
Permission = get_permission_model()
count = Permission.objects.cleanup()
if count:
print('Deleted %d permissions.' % count)
Role = get_role_model()
count = 0
count = Role.objects.cleanup()
if count:
print('Deleted %d roles.' % count)