PHP Class BookStack\Http\Controllers\Controller

Inheritance: extends Illuminate\Routing\Controller, use trait Illuminate\Foundation\Bus\DispatchesJobs, use trait Illuminate\Foundation\Validation\ValidatesRequests
Afficher le fichier Open project: ssddanbrown/bookstack Class Usage Examples

Protected Properties

Свойство Type Description
$currentUser static
$signedIn boolean

Méthodes publiques

Méthode Description
__construct ( ) Controller constructor.
setPageTitle ( $title ) Adds the page title into the view.

Méthodes protégées

Méthode Description
buildFailedValidationResponse ( Illuminate\Http\Request $request, array $errors ) : Response Create the response for when a request fails validation.
checkOwnablePermission ( $permission, Ownable $ownable ) : boolean Check the current user's permissions against an ownable item.
checkPermission ( string $permissionName ) : boolean | Illuminate\Http\RedirectResponse Checks for a permission.
checkPermissionOr ( $permissionName, $callback ) : boolean Check if a user has a permission or bypass if the callback is true.
jsonError ( string $messageText = "", integer $statusCode = 500 ) : mixed Send back a json error message.
preventAccessForDemoUsers ( ) Stops the application and shows a permission error if the application is in demo mode.
showPermissionError ( ) On a permission error redirect to home and display.

Method Details

__construct() public méthode

Controller constructor.
public __construct ( )

buildFailedValidationResponse() protected méthode

Create the response for when a request fails validation.
protected buildFailedValidationResponse ( Illuminate\Http\Request $request, array $errors ) : Response
$request Illuminate\Http\Request
$errors array
Résultat Symfony\Component\HttpFoundation\Response

checkOwnablePermission() protected méthode

Check the current user's permissions against an ownable item.
protected checkOwnablePermission ( $permission, Ownable $ownable ) : boolean
$permission
$ownable BookStack\Ownable
Résultat boolean

checkPermission() protected méthode

Checks for a permission.
protected checkPermission ( string $permissionName ) : boolean | Illuminate\Http\RedirectResponse
$permissionName string
Résultat boolean | Illuminate\Http\RedirectResponse

checkPermissionOr() protected méthode

Check if a user has a permission or bypass if the callback is true.
protected checkPermissionOr ( $permissionName, $callback ) : boolean
$permissionName
$callback
Résultat boolean

jsonError() protected méthode

Send back a json error message.
protected jsonError ( string $messageText = "", integer $statusCode = 500 ) : mixed
$messageText string
$statusCode integer
Résultat mixed

preventAccessForDemoUsers() protected méthode

Stops the application and shows a permission error if the application is in demo mode.

setPageTitle() public méthode

Adds the page title into the view.
public setPageTitle ( $title )
$title

showPermissionError() protected méthode

the error as a notification.
protected showPermissionError ( )

Property Details

$currentUser protected_oe property

static
protected $currentUser

$signedIn protected_oe property

protected bool $signedIn
Résultat boolean