mirror of
https://github.com/lempamo/Project-Unite.git
synced 2025-01-23 01:32:16 +00:00
Another ACL bug.
This commit is contained in:
parent
4654aaea6b
commit
bf85c3cda2
1 changed files with 9 additions and 3 deletions
|
@ -46,9 +46,15 @@ public static IHtmlString UserName(this HtmlHelper hpr, string userId)
|
||||||
{
|
{
|
||||||
userRoles.Add(db.Roles.FirstOrDefault(r => r.Id == usrRole.RoleId) as Role);
|
userRoles.Add(db.Roles.FirstOrDefault(r => r.Id == usrRole.RoleId) as Role);
|
||||||
}
|
}
|
||||||
var userRole = userRoles.OrderByDescending(m => m.Priority).First();
|
var userRole = userRoles.OrderByDescending(m => m.Priority).FirstOrDefault();
|
||||||
|
if (userRole == null)
|
||||||
|
{
|
||||||
|
return hpr.Raw($@"<strong>{hpr.Encode(usr.DisplayName)}</strong>");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
return hpr.Raw($@"<strong style=""color:{userRole.ColorHex}"">{hpr.Encode(usr.DisplayName)}</strong>");
|
return hpr.Raw($@"<strong style=""color:{userRole.ColorHex}"">{hpr.Encode(usr.DisplayName)}</strong>");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue