pull/26/head
liuzheng712 2015-10-28 10:55:25 +08:00
parent ca271900e6
commit 4d3e7d694b
3 changed files with 5 additions and 5 deletions

View File

@ -14,7 +14,7 @@
name: group_admin name: group_admin
password: pbkdf2_sha256$20000$ttObUWd15q10$NJoyZf2OZz9oiw2g4j2TkTh9zGgyVDRFdUkhn8X0nB0= password: pbkdf2_sha256$20000$ttObUWd15q10$NJoyZf2OZz9oiw2g4j2TkTh9zGgyVDRFdUkhn8X0nB0=
email: group_admin@jumpserver.org email: group_admin@jumpserver.org
role: DA role: GA
is_active: 1 is_active: 1
- model: juser.usergroup - model: juser.usergroup
pk: 1 pk: 1

View File

@ -499,9 +499,8 @@ def is_role_request(request, role='user'):
require this request of user is right require this request of user is right
要求请求角色正确 要求请求角色正确
""" """
role_all = {'user': 0, 'admin': 1, 'super': 2} role_all = {'user': 'CU', 'admin': 'GA', 'super': 'SU'}
# TODO: liuzheng's work if request.user.role == role_all.get(role, 'CU'):
if request.session.get('role_id') == role_all.get(role, 0):
return True return True
else: else:
return False return False

View File

@ -14,7 +14,8 @@ from juser.user_api import *
def chg_role(request): def chg_role(request):
role = {'SU': 2, 'DA': 1, 'CU': 0} # TODO: disable it! by liuzheng
role = {'SU': 2, 'GA': 1, 'CU': 0}
user, dept = get_session_user_dept(request) user, dept = get_session_user_dept(request)
# TODO: liuzheng's work # TODO: liuzheng's work
if request.session['role_id'] > 0: if request.session['role_id'] > 0: