fix(#I188NA): Administrators Default 内置角色增加保护

#Comment
comment #I188NA

#Issue
close https://gitee.com/LongbowEnterprise/dashboard/issues?id=I188NA
This commit is contained in:
Argo Zhang 2020-01-11 11:42:50 +08:00
parent 69f31a3ba4
commit 76a80d6a97
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ namespace Bootstrap.DataAccess
// 内置两个角色禁止修改
var roles = new string[] { "Administrators", "Default" };
var rs = Retrieves().Where(r => roles.Any(rl => rl.Equals(r.RoleName, StringComparison.OrdinalIgnoreCase)));
if (rs.Any(r => r.Id == p.Id)) return true;
if (rs.Any()) return true;
var ret = DbContextManager.Create<Role>()?.Save(p) ?? false;
if (ret) CacheCleanUtility.ClearCache(roleIds: string.IsNullOrEmpty(p.Id) ? new List<string>() : new List<string> { p.Id });