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