BookStack\Http\Controllers\ChapterController::restrict PHP Method

restrict() public method

Set the restrictions for this chapter.
public restrict ( $bookSlug, $chapterSlug, Illuminate\Http\Request $request ) : Illuminate\Http\RedirectResponse | Redirector
$bookSlug
$chapterSlug
$request Illuminate\Http\Request
return Illuminate\Http\RedirectResponse | Illuminate\Routing\Redirector
    public function restrict($bookSlug, $chapterSlug, Request $request)
    {
        $book = $this->bookRepo->getBySlug($bookSlug);
        $chapter = $this->chapterRepo->getBySlug($chapterSlug, $book->id);
        $this->checkOwnablePermission('restrictions-manage', $chapter);
        $this->chapterRepo->updateEntityPermissionsFromRequest($request, $chapter);
        session()->flash('success', 'Chapter Restrictions Updated');
        return redirect($chapter->getUrl());
    }