mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-25 06:16:37 +01:00
CA-343229: Add Helper function to fetch list of logged in subjects
Signed-off-by: Danilo Del Busso <Danilo.Del.Busso@citrix.com>
This commit is contained in:
parent
f7527534e5
commit
4fe544a8e0
@ -1912,6 +1912,12 @@ namespace XenAdmin.Core
|
|||||||
return connection?.Cache.GPU_groups.Any(g => g.PGPUs.Count > 0 && g.supported_VGPU_types.Count != 0) ?? false;
|
return connection?.Cache.GPU_groups.Any(g => g.PGPUs.Count > 0 && g.supported_VGPU_types.Count != 0) ?? false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<Subject> LoggedInSubjects(IXenConnection connection)
|
||||||
|
{
|
||||||
|
var loggedInSids = connection.Session.get_all_subject_identifiers();
|
||||||
|
return connection.Cache.Subjects.Where(sub => loggedInSids.Contains(sub.subject_identifier)).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
public static bool ConnectionRequiresRbac(IXenConnection connection)
|
public static bool ConnectionRequiresRbac(IXenConnection connection)
|
||||||
{
|
{
|
||||||
if (connection?.Session == null)
|
if (connection?.Session == null)
|
||||||
|
Loading…
Reference in New Issue
Block a user