mirror of
https://github.com/lempamo/Project-Unite.git
synced 2025-01-22 11:21:47 -05: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);
|
||||
}
|
||||
var userRole = userRoles.OrderByDescending(m => m.Priority).First();
|
||||
return hpr.Raw($@"<strong style=""color:{userRole.ColorHex}"">{hpr.Encode(usr.DisplayName)}</strong>");
|
||||
|
||||
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>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue