Airship\Cabin\Bridge\Landing\Ajax::permissionTest PHP Method

permissionTest() public method

public permissionTest ( )
    public function permissionTest()
    {
        if (!$this->isSuperUser()) {
            \Airship\json_response(['status' => 'ERROR', 'message' => \__('You are not an administrator.')]);
        }
        if (empty($_POST['url'])) {
            \Airship\json_response(['status' => 'ERROR', 'message' => \__('You must enter a URL.')]);
        }
        try {
            $cabin = $this->getCabinNameFromURL($_POST['url']);
            $this->getPermissionDataForURL($_POST['url'], $cabin);
        } catch (CabinNotFound $ex) {
            \Airship\json_response(['status' => 'ERROR', 'message' => \__('URL does not resolve to an existing Cabin.')]);
        }
    }