Auto-generated site groups permissions are updated when role group changes.
_get_permissions_dict always returns the same result so it doesn't make sense to call it in every iteration of the for loop
Merge branch 'LUN-877'