src/PermissionMatcher.php
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;
    }
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;
    }
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 ; }
Populate an array of privileges with their corresponding authz groups

@param  array          $privileges            The resulting array
@param  string|array   $authzGroupsPrivileges The privileges that the authzgroup has
@param  array          $authzGroups
@return array          $privileges
Populate an array of privileges with their corresponding authz groups