protected function addAuthzGroupsToPrivileges(array $privileges, $authzGroupsPrivileges, array $authzGroups)
    {
        $authzGroupsPrivileges = !is_string($authzGroupsPrivileges) ? $authzGroupsPrivileges : [$authzGroupsPrivileges];
        
        foreach($authzGroupsPrivileges as $privilege) {
            $current = !empty($privileges[$privilege]) ? $privileges[$privilege] : [];
            $privileges[$privilege] = array_unique(array_merge($current, $authzGroups));
        }
        
        return $privileges;
    }