Skip to content

Commit d94972b

Browse files
committed
refactor: enhance role management by adding user-specific role filtering and permissions checks
1 parent 17e1cbc commit d94972b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

apps/chat/serializers/chat_authentication.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def reset_application(application, application_version):
8686
'user_id': 'user_id', 'model_id': 'model_id', 'knowledge_setting': 'knowledge_setting',
8787
'model_setting': 'model_setting', 'model_params_setting': 'model_params_setting',
8888
'tts_model_params_setting': 'tts_model_params_setting',
89-
'problem_optimization': 'problem_optimization', 'icon': 'icon', 'work_flow': 'work_flow',
89+
'problem_optimization': 'problem_optimization', 'work_flow': 'work_flow',
9090
'problem_optimization_prompt': 'problem_optimization_prompt', 'tts_model_id': 'tts_model_id',
9191
'stt_model_id': 'stt_model_id', 'tts_model_enable': 'tts_model_enable',
9292
'stt_model_enable': 'stt_model_enable', 'tts_type': 'tts_type',

apps/users/views/user.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ class RePasswordView(APIView):
290290
@log(menu='User management', operate='Change password',
291291
get_operation_object=lambda r, k: {'name': r.user.username},
292292
get_details=get_re_password_details)
293+
@has_permissions(PermissionConstants.USER_EDIT, RoleConstants.ADMIN)
293294
def post(self, request: Request):
294295
serializer_obj = RePasswordSerializer(data=request.data)
295296
return result.success(serializer_obj.reset_password(request.user.id))

0 commit comments

Comments
 (0)