django_rbac: remove unused code (#70894)
This commit is contained in:
parent
ba71c350b4
commit
14e25ac186
|
@ -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'
|
|
|
@ -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)
|
|
Loading…
Reference in New Issue