public function edit($channelId, $typeId, $type, $allow = null, $deny = null)
    {
        $current = $this->show($channelId, $typeId, $type);
        if (is_null($current)) {
            return $this->create($channelId, $typeId, $type, $allow, $deny);
        }
        if (is_null($allow)) {
            $allow = $current['allow'];
        }
        if (is_null($deny)) {
            $deny = $current['deny'];
        }
        return $this->request('PUT', 'channels/' . $channelId . '/permissions/' . $typeId, [
            'json' => [
                'type' => $current['type'],
                'id' => $current['id'],
                'allow' => $allow,
                'deny' => $deny
            ]
        ]);
    }