vistor perm
This commit is contained in:
parent
2e4e801078
commit
71a0533cb6
|
@ -16,6 +16,13 @@ ConsumerPerms = [
|
||||||
'exercise'
|
'exercise'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
VistorPerms = [
|
||||||
|
'gen_monitest',
|
||||||
|
'questioncat_list',
|
||||||
|
'article_list',
|
||||||
|
'my_examtest',
|
||||||
|
]
|
||||||
|
|
||||||
class MyPermission(RbacPermission):
|
class MyPermission(RbacPermission):
|
||||||
|
|
||||||
def has_permission(self, request, view):
|
def has_permission(self, request, view):
|
||||||
|
@ -32,7 +39,10 @@ class MyPermission(RbacPermission):
|
||||||
# perms = get_permission_list(request.user)
|
# perms = get_permission_list(request.user)
|
||||||
return True
|
return True
|
||||||
elif isinstance(request.user,Consumer):
|
elif isinstance(request.user,Consumer):
|
||||||
perms = ConsumerPerms
|
if request.user.workscope:
|
||||||
|
perms = ConsumerPerms
|
||||||
|
else:
|
||||||
|
perms = VistorPerms
|
||||||
if perms:
|
if perms:
|
||||||
if not hasattr(view, 'perms_map'):
|
if not hasattr(view, 'perms_map'):
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue