mirror of
https://github.com/lempamo/Project-Unite.git
synced 2025-02-02 13:07:34 +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 @@ namespace Project_Unite
|
||||||
using(var db = new ApplicationDbContext())
|
using(var db = new ApplicationDbContext())
|
||||||
{
|
{
|
||||||
var usr = db.Users.Include(x=>x.Roles).FirstOrDefault(x => x.Id == userId);
|
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>();
|
var userRoles = new List<Role>();
|
||||||
foreach (var usrRole in usr.Roles)
|
foreach (var usrRole in usr.Roles)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue