diff --git a/test_server/crm/permission.py b/test_server/crm/permission.py index e7ce9dc..ac133d4 100644 --- a/test_server/crm/permission.py +++ b/test_server/crm/permission.py @@ -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