public function setPermissions($entity, $objectId, $groupId, $view, $edit, $delete, $ownerId = null)
    {
        $this->getLogger()->info('Setting Permissions view ' . $view . ' edit ' . $edit . ' delete ' . $delete . ' for user group ID ' . $groupId . ' to Entity ' . $entity . ' with ID ' . $objectId);

        $this->entity = $entity;
        $this->objectId = $objectId;
        $this->groupId = $groupId;
        $this->view = $view;
        $this->edit = $edit;
        $this->delete = $delete;
        $this->ownerId = $ownerId;

        $response = $this->doPost('/user/permissions/' . $entity . '/' . $objectId, [
            'groupIds' => [
               $groupId => [
                   'view' => $view,
                   'edit' => $edit,
                   'delete' => $delete
               ]
           ],
            'ownerId' => $ownerId
        ]);

        return $this->hydrate($response);
    }