fix(#I188NA): Administrators Default 内置角色增加保护
#Comment comment #I188NA #Issue close https://gitee.com/LongbowEnterprise/dashboard/issues?id=I188NA
This commit is contained in:
parent
69f31a3ba4
commit
76a80d6a97
|
@ -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 });
|
||||
|
|
Loading…
Reference in New Issue