1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Started work on making the public role/user configurable

Create a new 'public' guest user and made the public
role visible on role setting screens.
This commit is contained in:
Dan Brown
2016-09-29 12:43:46 +01:00
parent f15cc5bdfa
commit 771626b6ec
19 changed files with 156 additions and 48 deletions

View File

@ -33,17 +33,16 @@ abstract class Controller extends BaseController
$this->middleware(function ($request, $next) {
// Get a user instance for the current user
$user = auth()->user();
if (!$user) $user = User::getDefault();
// Share variables with views
view()->share('signedIn', auth()->check());
view()->share('currentUser', $user);
$user = user();
// Share variables with controllers
$this->currentUser = $user;
$this->signedIn = auth()->check();
// Share variables with views
view()->share('signedIn', $this->signedIn);
view()->share('currentUser', $user);
return $next($request);
});
}