Notifications

27 views

Description

getMyGroups returning inconsistent results in domain separated instance.

Steps to Reproduce

1. Install domain seperation plugin.
2. Add a user roger.seid to the domain TOP/Cisco.
3. Create a new domain TOP/Cisco/Cisco C and a new group "T-in" in it.
4. Add the user to this group and make sure that the group membership record is in parent domain. (Cisco)

5. Run the following script that places the user into lower domain, clears the cache, and re-populates it.
Here
TOP/Cisco-- user's domain
- TOP/Cisco/Cisco C -- group's domain

a)
var USER_SYS_ID = '9795f864dbf1aa008f94fb5aaf96199c';
var DOMAIN_ID = 'e58ab7ccdbb593807b25e1d3ca961987'; //TOP/Cisco/Cisco C -- group's domain
try {
var origUser = session.onlineImpersonate(USER_SYS_ID);
gs.print('Impersonating: ' + gs.getUserName());
GlideSession.get().setDomainID(DOMAIN_ID);
GlideCacheManager.flush('ZZGROUPMEMBERCACHEYY');
gs.print("getMyGroups: " + gs.getUser().getMyGroups());
} finally {
session.onlineUnimpersonate();
}
*** Script: Impersonating: roger.seid
*** Script: getMyGroups: []

b) As a result, the cache will be populated without the expected group-membership:
var USER_SYS_ID = '9795f864dbf1aa008f94fb5aaf96199c';
try {
var origUser = session.onlineImpersonate(USER_SYS_ID);
gs.print('Impersonating: ' + gs.getUserName());
gs.print("getMyGroups: " + gs.getUser().getMyGroups());
} finally {
session.onlineUnimpersonate();
}
*** Script: Impersonating: roger.seid
*** Script: getMyGroups: []

c) clean cache:
GlideCacheManager.flush('ZZGROUPMEMBERCACHEYY');

d) re-run script from 2), now the result will be as expected:
*** Script: Impersonating: roger.seid
*** Script: getMyGroups: [69c47f9f6f797500e94289f1be3ee469]

Here 69c47f9f6f797500e94289f1be3ee469 is the sys_id for the group.



Workaround

This problem has been fixed. If you are able to upgrade, review the Fixed In or Intended Fix Version fields to determine whether any versions have a planned or permanent fix.


Related Problem: PRB1315459

Seen In

There is no data to report.

Fixed In

Madrid

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2019-09-19 16:15:41
Published:2019-09-19