mirror of
https://github.com/lempamo/Project-Unite.git
synced 2025-01-23 01:32:16 +00:00
Patch ACL.UserLink
Assume system user if no user matching the ID was found.
This commit is contained in:
parent
35aa49e73f
commit
303ef44a18
1 changed files with 2 additions and 1 deletions
|
@ -113,7 +113,8 @@ public static IHtmlString UserLink(this HtmlHelper hpr, string userId)
|
|||
using(var db = new ApplicationDbContext())
|
||||
{
|
||||
var usr = db.Users.Include(x=>x.Roles).FirstOrDefault(x => x.Id == userId);
|
||||
|
||||
if (usr == null)
|
||||
return hpr.Raw("<a href=\"#\">system</a>");
|
||||
var userRoles = new List<Role>();
|
||||
foreach (var usrRole in usr.Roles)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue