LPS-33205

Hi, one important info: I put the previousGroupRoles declaration to the top beause at the method call it's too late for it and it didn't seem to fit into any of the preceding categories.