mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2026-02-15 21:06:32 +08:00
流程跳转
This commit is contained in:
@@ -40,5 +40,18 @@ namespace OpenAuth.Repository
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
public IEnumerable<Role> LoadForUser(Guid userId)
|
||||
{
|
||||
|
||||
if (userId == Guid.Empty)
|
||||
return Find(null);
|
||||
|
||||
var userRoleIds =
|
||||
Context.Relevances.Where(u => u.FirstId == userId && u.Key == "UserRole")
|
||||
.Select(u => u.SecondId).ToList();
|
||||
|
||||
return Find(u => userRoleIds.Contains(u.Id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user