From a69c9df63ef7aac68afcce4bf0e4ce116e7b0269 Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Tue, 1 Nov 2016 16:53:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9BUG=EF=BC=8C=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E7=99=BB=E9=99=86=E7=94=A8=E6=88=B7=E6=98=AF=E7=BD=91?= =?UTF-8?q?=E7=AB=99=E9=85=8D=E7=BD=AE=E7=9A=84=E8=B6=85=E7=BA=A7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=91=98=EF=BC=8C=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA?= =?UTF-8?q?DisplayName=E5=AF=BC=E8=87=B4=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.DataAccess/UserHelper.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Bootstrap.DataAccess/UserHelper.cs b/Bootstrap.DataAccess/UserHelper.cs index 0d98299a..4fd1f6f8 100644 --- a/Bootstrap.DataAccess/UserHelper.cs +++ b/Bootstrap.DataAccess/UserHelper.cs @@ -61,6 +61,7 @@ namespace Bootstrap.DataAccess /// public static User RetrieveUsersByName(string userName) { + if (Longbow.Security.Principal.LgbPrincipal.IsAdmin(userName)) return new User() { DisplayName = "网站管理员", UserName = userName }; string key = string.Format("{0}{1}", UserDisplayNameDataKey, userName); return CacheManager.GetOrAdd(key, CacheSection.RetrieveIntervalByKey(UserDisplayNameDataKey), k => { @@ -173,7 +174,7 @@ namespace Bootstrap.DataAccess /// public static IEnumerable RetrieveUsersByRoleId(int roleId) { - + string key = string.Format("{0}{1}", UserRoleIDDataKey, roleId); return CacheManager.GetOrAdd(key, CacheSection.RetrieveIntervalByKey(UserDisplayNameDataKey), k => { @@ -241,10 +242,10 @@ namespace Bootstrap.DataAccess transaction.CommitTransaction(); } } - ret= true; + ret = true; ClearCache(); } - catch(Exception ex) + catch (Exception ex) { ExceptionManager.Publish(ex); transaction.RollbackTransaction(); @@ -299,7 +300,7 @@ namespace Bootstrap.DataAccess bool ret = false; DataTable dt = new DataTable(); dt.Columns.Add("UserID", typeof(int)); - dt.Columns.Add("GroupID", typeof(int)); + dt.Columns.Add("GroupID", typeof(int)); if (!string.IsNullOrEmpty(userIds)) { userIds.Split(',').ToList().ForEach(userId =>