Provide missing default attachment list for Files transactions
[phabricator.git] / src / aphront / response / Aphront403Response.php
blob3d3d5c9457c5ce8b166bb79526b2d5f99db4bf90
1 <?php
3 final class Aphront403Response extends AphrontHTMLResponse {
5 private $forbiddenText;
6 public function setForbiddenText($text) {
7 $this->forbiddenText = $text;
8 return $this;
10 private function getForbiddenText() {
11 return $this->forbiddenText;
14 public function getHTTPResponseCode() {
15 return 403;
18 public function buildResponseString() {
19 $forbidden_text = $this->getForbiddenText();
20 if (!$forbidden_text) {
21 $forbidden_text =
22 pht('You do not have privileges to access the requested page.');
25 $request = $this->getRequest();
26 $user = $request->getUser();
28 $dialog = id(new AphrontDialogView())
29 ->setUser($user)
30 ->setTitle(pht('403 Forbidden'))
31 ->addCancelButton('/', pht('Yikes!'))
32 ->appendParagraph($forbidden_text);
34 $view = id(new PhabricatorStandardPageView())
35 ->setTitle(pht('403 Forbidden'))
36 ->setRequest($request)
37 ->setDeviceReady(true)
38 ->appendChild($dialog);
40 return $view->render();