public function match($permissions, array $authzGroups)
    {
        $privileges = [];

        foreach ($permissions as $permissionAuthzGroup => $permissionPrivileges) {
            $matchingAuthzGroup = $this->getMatchingAuthzGroup($permissionAuthzGroup, $authzGroups);
            
            if (!$matchingAuthzGroup) {
                continue;
            }
            
            $privileges[] = $permissionPrivileges;
        }

        return $this->flatten($privileges);
    }
public function match($permissions, array $authzGroups)
    {
        $privileges = [];

        foreach ($permissions as $permissionAuthzGroup => $permissionPrivileges) {
            $matchingAuthzGroup = $this->getMatchingAuthzGroup($permissionAuthzGroup, $authzGroups);
            
            if (!$matchingAuthzGroup) {
                continue;
            }
            
            $privileges[] = $permissionPrivileges;
        }

        return $this->flatten($privileges);
    }
public function match ( $ permissions , array $ authzGroups ) { $ privileges = [ ] ; foreach ( $ permissions as $ permissionAuthzGroup => $ permissionPrivileges ) { $ matchingAuthzGroup = $ this -> getMatchingAuthzGroup ( $ permissionAuthzGroup , $ authzGroups ) ; if ( ! $ matchingAuthzGroup ) { continue ; } $ privileges [ ] = $ permissionPrivileges ; } return $ this -> flatten ( $ privileges ) ; }
Get a flat list of privileges for matching authz groups

@param array|object $permissions
@param array        $authzGroups
@return array
Get a flat list of privileges for matching authz groups