Resorting to actually asking for insight via forum, lol...
Genesys Configuration Server version 8.5.101.92. (I believe our SDK is still 8.1.300.50)
Been trying to code simple logic to remove a person from one or more Access Groups. We've already got existing, working logic to add persons to Access Groups, and for the new remove logic, we're using the same person objects and access group objects, so not sure why remove doesn't work.
Nothing tried has worked, but I also see no helpful error messages letting me know why (E.g. permissions, objects don't exist, etc).
Mainly have been attempting to remove a person from an access group with the following:
[code]
CfgID personToRemove = new CfgID(mConfService, person)
{
DBID = person.DBID,
Type = CfgObjectType.CFGPerson
};
var result = accessGroup.MemberIDs.Remove(personToRemove);
if (result)
{
accessGroup.Save();
Log.Debug("Updated profile " + person.UserName.ToString() + ". Removed access group: " + grp + "(" + dbidNumber + ")");
}
else
{
Log.Debug("Did not update Profile " + person.UserName.ToString() + ". Could not remove profile from access group: " + grp + "(" + dbidNumber + ")");
}
[/code]
It always goes to "Did not update Profile" [[i]sic[/i] - I know we're updating the Access Group at this stage].
-----
When that approach never worked, after many attempts and variations, discovered another method in the CfgAccessGroup Class, called RemoveAccount(). Tried that (below), but no luck there either.
[code]
var person = FindByUserName(profileData.UserName);
accessGroup.RemoveAccount(person, false);
accessGroup.Save();
Log.Debug("Updated profile " + person.UserName.ToString() + ". Removed access group: " + grp + "(" + dbidNumber + ")");
[/code]
-----
API user has Super Administrator role, so allegedly has Full Control over access groups, etc. Have tried going through Config Server Proxy, but also directly to main Config Server.
Any advice on the matter would be greatly appreciated.