CP-38893: Make internal roles unavailable for selection.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2022-01-29 01:40:37 +00:00
parent 50dd22f4da
commit 6aec4ea281
2 changed files with 6 additions and 2 deletions

View File

@ -82,7 +82,9 @@ namespace XenAdmin.Dialogs
}
// Get the list of roles off the server and arrange them into rank
var serverRoles = connection.Cache.Roles.Where(r => r.subroles.Count > 0).OrderBy(r => r).Reverse().ToList();
var serverRoles = connection.Cache.Roles
.Where(r => (!Helpers.Post82X(connection) || !r.is_internal) && r.subroles.Count > 0)
.OrderBy(r => r).Reverse().ToList();
_subjectsPerRole = new Dictionary<Role, List<Subject>>();
foreach (Role role in serverRoles)

View File

@ -63,7 +63,9 @@ namespace XenAdmin.Actions
protected override void Run()
{
var serverRoles = Connection.Cache.Roles.Where(r => r.subroles.Count > 0).ToList();
var serverRoles = Connection.Cache.Roles
.Where(r => (!Helpers.Post82X(Connection) || !r.is_internal) && r.subroles.Count > 0)
.ToList();
var toAdd = serverRoles.Where(role => _newRoles.Contains(role) &&
!subject.roles.Contains(new XenRef<Role>(role.opaque_ref))).ToList();