diff --git a/FrontendWebApi/ApiControllers/UserController.cs b/FrontendWebApi/ApiControllers/UserController.cs index 16b3b60..e129888 100644 --- a/FrontendWebApi/ApiControllers/UserController.cs +++ b/FrontendWebApi/ApiControllers/UserController.cs @@ -596,20 +596,23 @@ namespace FrontendWebApi.ApiControllers } else { + await backendRepository.ExecuteSql($"delete from role_auth where role_guid = '{post.SelectedRoleId}' and AuthCode like '%PF%'"); if (post.SaveCheckAuth.Count > 0) { foreach (var item in post.SaveCheckAuth) { #region 新增權限 - Dictionary roleAuth = new Dictionary(); - roleAuth = new Dictionary() - { - { "@role_guid", post.SelectedRoleId}, - { "@AuthCode", item}, - { "@created_by", myUser.userinfo_guid} - }; + { + Dictionary roleAuth = new Dictionary(); + roleAuth = new Dictionary() + { + { "@role_guid", post.SelectedRoleId}, + { "@AuthCode", item}, + { "@created_by", myUser.userinfo_guid} + }; - await backendRepository.AddOneByCustomTable(roleAuth, "role_auth"); + await backendRepository.AddOneByCustomTable(roleAuth, "role_auth"); + } #endregion } }