fix(#I1AL3V): 修复角色维护中可以更改角色名称问题
#Comment comment #I1AL3V #Issue close https://gitee.com/LongbowEnterprise/dashboard/issues?id=I1AL3V
This commit is contained in:
parent
819890dff2
commit
daf3e32724
|
@ -88,8 +88,8 @@ namespace Bootstrap.DataAccess
|
|||
public static bool Save(Role p)
|
||||
{
|
||||
// 内置两个角色禁止修改
|
||||
var roles = new string[] { "Administrators", "Default" };
|
||||
if (roles.Any(r => r.Equals(p.RoleName, StringComparison.OrdinalIgnoreCase))) return true;
|
||||
var roles = Retrieves().Where(r => new string[] { "Administrators", "Default" }.Any(s => s.Equals(r.RoleName, StringComparison.OrdinalIgnoreCase))).Select(r => r.Id ?? "");
|
||||
if (!string.IsNullOrEmpty(p.Id) && roles.Any(r => r.Equals(p.Id, StringComparison.OrdinalIgnoreCase))) 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