Merge "Improve permission group handling."