mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
349 B
14 lines
349 B
3 years ago
|
from django.contrib.auth.backends import ModelBackend
|
||
|
|
||
|
|
||
|
class RBACBackend(ModelBackend):
|
||
|
def has_perm(self, user_obj, perm, obj=None):
|
||
|
if not user_obj.is_active:
|
||
|
return False
|
||
|
|
||
|
has_perm = perm in user_obj.perms
|
||
|
return has_perm
|
||
|
#
|
||
|
# def has_module_perms(self, user_obj, app_label):
|
||
|
# return True
|