Airship\Cabin\Bridge\Blueprint\Permissions::getUserRulesForContextSave PHP Method

getUserRulesForContextSave() protected method

protected getUserRulesForContextSave ( array $actions, integer $contextId ) : array
$actions array
$contextId integer
return array
    protected function getUserRulesForContextSave(array $actions, int $contextId) : array
    {
        $perms = [];
        $userIds = $this->db->first('SELECT DISTINCT userid FROM airship_perm_rules WHERE context = ? AND userid IS NOT NULL', $contextId);
        foreach ($userIds as $user) {
            $allowed = $this->getUserPerms((int) $user, $contextId);
            foreach ($actions as $act) {
                $perms[$user][$act] = \in_array($act, $allowed);
            }
        }
        return $perms;
    }