XF 2.0 Need help with a permissions system

XenConcept

Well-known member
Hello,

I try to add a system of permissions for an addon as for the nodes but I do not see what to do in the following function:

PS : I have no child element

PHP:
abstract public function rebuildCombination(\XF\Entity\PermissionCombination $combination, array $basePerms);

PHP:
abstract public function getAnalysisContentPairs();

PHP:
abstract public function analyzeCombination(
        \XF\Entity\PermissionCombination $combination, $contentId, array $basePerms, array $baseIntermediates
 );

This is what I have done for the moment:

PHP:
public function analyzeCombination(
        \XF\Entity\PermissionCombination $combination, $contentId, array $basePerms, array $baseIntermediates
    )
    {

        $groupIds = $combination->user_group_list;
        $userId = $combination->user_id;

        $intermediates = $baseIntermediates;
        $permissions = $basePerms;
        $finalPerms = [];
        $dependChanges = [];

        $permissions = $this->adjustBasePermissionAllows($permissions);

        $sets = $this->getApplicablePermissionSets($contentId, $groupIds, $userId);
        $permissions = $this->builder->calculatePermissions($sets, $this->permissionsGrouped, $permissions);

        $calculated = $this->builder->applyPermissionDependencies(
            $permissions, $this->permissionsGrouped, $dependChanges
        );

        $finalPerms = $this->builder->finalizePermissionValues($calculated);

        $thisIntermediates = $this->builder->collectIntermediates(
            $combination, $permissions, $sets, $contentId, $this->getContentTitle($contentId)
        );
        $intermediates = $this->builder->pushIntermediates($intermediates, $thisIntermediates);

       return $this->builder->getFinalAnalysis($finalPerms, $intermediates, $dependChanges);
    }


The other two functions I do not know too much
 
@Chris D @Mike

After a lot of research I do not know what to do in

PHP:
public function getAnalysisContentPairs()
 {

    }

and

PHP:
public function rebuildCombination(\XF\Entity\PermissionCombination $combination, array $basePerms)
{

}

Could you help me ?
 
Back
Top Bottom