From 3c2850c4e722841717870f341607b23cf7562ba4 Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Fri, 23 Feb 2018 16:41:47 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8D=95No.138716=20?= =?UTF-8?q?=E5=B1=A0=E5=AE=B0=E5=88=86=E5=89=B2=E5=AE=A2=E6=88=B7=E7=AB=AF?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=8C=89=E7=99=BB=E5=BD=95=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E6=9D=83=E9=99=90=E5=88=92=E5=88=86=EF=BC=8C?= =?UTF-8?q?=E6=AF=8F=E4=B8=AA=E5=AE=A2=E6=88=B7=E7=AB=AF=E5=8F=AA=E6=9C=89?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E9=85=8D=E7=BD=AE=E7=94=A8=E6=88=B7=E6=9C=89?= =?UTF-8?q?=E6=9D=83=E9=99=90=E7=99=BB=E5=BD=95=E6=89=8D=E8=83=BD=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B3ClientService/Rpcs/UserInfoRpc.cs | 6 ++++++ B3ClientService/Tasks/SyncInfoFromServer.cs | 4 ++-- .../config/plugins/B3ClientService.plugin | 20 +++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/B3ClientService/Rpcs/UserInfoRpc.cs b/B3ClientService/Rpcs/UserInfoRpc.cs index 891a64b..0dc58a2 100644 --- a/B3ClientService/Rpcs/UserInfoRpc.cs +++ b/B3ClientService/Rpcs/UserInfoRpc.cs @@ -32,5 +32,11 @@ namespace BWP.B3ClientService.Rpcs query.Range = SelectRange.Top(1); return query.EExecuteScalar(); } + + [Rpc] + public static bool UserIsInRole(string roleName) + { + return BLContext.Current.User.IsInRole("B3ClientService." + roleName); + } } } diff --git a/B3ClientService/Tasks/SyncInfoFromServer.cs b/B3ClientService/Tasks/SyncInfoFromServer.cs index 17dbc7d..8ed730f 100644 --- a/B3ClientService/Tasks/SyncInfoFromServer.cs +++ b/B3ClientService/Tasks/SyncInfoFromServer.cs @@ -198,7 +198,7 @@ namespace BWP.B3ClientService.Tasks entity.Name = o.Get("Name"); entity.Stopped = o.Get("Stopped"); entity.Password = o.Get("Password"); - entity.RoleSchema = o.Get("RoleSchema"); + entity.RoleSchema = "default";//o.Get("RoleSchema"); context.Session.Insert(entity); } var sql2 = @"SET IDENTITY_INSERT [WPF_User] OFF;"; @@ -271,7 +271,7 @@ namespace BWP.B3ClientService.Tasks entity.Department_Name = o.Get("Department_Name"); entity.AccountingUnit_ID = o.Get("AccountingUnit_ID"); entity.AccountingUnit_Name = o.Get("AccountingUnit_Name"); - entity.Role = o.Get("Role"); + //entity.Role = o.Get("Role"); context.Session.Insert(entity); } context.Commit(); diff --git a/WebFolder/config/plugins/B3ClientService.plugin b/WebFolder/config/plugins/B3ClientService.plugin index 6296580..a5d806d 100644 --- a/WebFolder/config/plugins/B3ClientService.plugin +++ b/WebFolder/config/plugins/B3ClientService.plugin @@ -12,6 +12,26 @@ + + + + + + + + + + + + + + + + + + + +