diff --git a/apps/rbac/const.py b/apps/rbac/const.py index a5a390306..d7f58e841 100644 --- a/apps/rbac/const.py +++ b/apps/rbac/const.py @@ -55,7 +55,7 @@ exclude_permissions = ( ('ops', 'task', 'add,change', 'task'), ('ops', 'commandexecution', 'delete,change', 'commandexecution'), ('orgs', 'organizationmember', '*', '*'), - ('settings', 'setting', 'add,delete', 'setting'), + ('settings', 'setting', 'add,change,delete', 'setting'), ('audits', 'operatelog', 'add,delete,change', 'operatelog'), ('audits', 'passwordchangelog', 'add,change,delete', 'passwordchangelog'), ('audits', 'userloginlog', 'add,change,delete,change', 'userloginlog'), diff --git a/apps/rbac/tree.py b/apps/rbac/tree.py index 6a40365f5..ee742d865 100644 --- a/apps/rbac/tree.py +++ b/apps/rbac/tree.py @@ -99,7 +99,6 @@ special_pid_mapper = { "xpack.interface": "view_setting", "settings.change_terminal": "terminal_node", "settings.view_setting": "view_setting", - "settings.change_setting": "view_setting", "rbac.view_console": "view_console", "rbac.view_audit": "view_audit", "rbac.view_workspace": "view_workspace", diff --git a/apps/settings/api/alibaba_sms.py b/apps/settings/api/alibaba_sms.py index b00487d51..8240ba0e0 100644 --- a/apps/settings/api/alibaba_sms.py +++ b/apps/settings/api/alibaba_sms.py @@ -14,7 +14,7 @@ from .. import serializers class AlibabaSMSTestingAPI(GenericAPIView): serializer_class = serializers.AlibabaSMSSettingSerializer rbac_perms = { - 'POST': 'settings.change_setting' + 'POST': 'settings.change_sms' } def post(self, request): diff --git a/apps/settings/api/email.py b/apps/settings/api/email.py index 78a406b24..495e4a15c 100644 --- a/apps/settings/api/email.py +++ b/apps/settings/api/email.py @@ -19,7 +19,7 @@ class MailTestingAPI(APIView): serializer_class = serializers.MailTestSerializer success_message = _("Test mail sent to {}, please check") rbac_perms = { - 'POST': 'settings.change_setting' + 'POST': 'settings.change_email' } def post(self, request): diff --git a/apps/settings/api/feishu.py b/apps/settings/api/feishu.py index 07d1d4ebd..ed3b51f9e 100644 --- a/apps/settings/api/feishu.py +++ b/apps/settings/api/feishu.py @@ -13,7 +13,7 @@ from .. import serializers class FeiShuTestingAPI(GenericAPIView): serializer_class = serializers.FeiShuSettingSerializer rbac_perms = { - 'POST': 'settings.change_setting' + 'POST': 'settings.change_auth' } def post(self, request): diff --git a/apps/settings/api/tencent_sms.py b/apps/settings/api/tencent_sms.py index 7b3d41061..83a87a474 100644 --- a/apps/settings/api/tencent_sms.py +++ b/apps/settings/api/tencent_sms.py @@ -16,7 +16,7 @@ from .. import serializers class TencentSMSTestingAPI(GenericAPIView): serializer_class = serializers.TencentSMSSettingSerializer rbac_perms = { - 'POST': 'settings.change_setting' + 'POST': 'settings.change_sms' } def post(self, request): diff --git a/apps/settings/api/wecom.py b/apps/settings/api/wecom.py index 622fde923..7fb4a0aed 100644 --- a/apps/settings/api/wecom.py +++ b/apps/settings/api/wecom.py @@ -13,7 +13,7 @@ from .. import serializers class WeComTestingAPI(GenericAPIView): serializer_class = serializers.WeComSettingSerializer rbac_perms = { - 'POST': 'settings.change_setting' + 'POST': 'settings.change_auth' } def post(self, request):