获取角色权限修改

usertest
cjy 4 months ago
parent 06b67403e4
commit 170f5a4d37

@ -206,7 +206,10 @@ public class SysRoleService : ISysRoleService
/// <returns></returns>
public DataResult<long?[]> GetRolePermission(string id)
{
var data = db.Queryable<SysRolePermission>().Where(x => x.RoleId == long.Parse(id) && x.IsPermission == 1).Select(x => x.PermissionId).ToArray();
var tempIds = db.Queryable<SysPermission>().Where(x=>x.MenuType == 1).Select(x => x.Id).ToList();
var data = db.Queryable<SysRolePermission>().Where(x => x.RoleId == long.Parse(id) && x.IsPermission == 1 && !tempIds.Contains((long)x.PermissionId))
.Select(x => x.PermissionId).ToArray();
return DataResult<long?[]>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}

Loading…
Cancel
Save