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:
Danilo Del Busso 2021-11-09 11:14:01 +00:00
parent f7527534e5
commit 4fe544a8e0
No known key found for this signature in database
GPG Key ID: 55F556F9A25CB037

View File

@ -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)