Added Demo mode
Demo mode allows to safely run a demo version of the app, with destructive features limited. Some bugs were also fixed in this commit.
This commit is contained in:
@@ -42,6 +42,12 @@ class BanController extends Controller
|
||||
|
||||
public function insert(BanUserRequest $request, User $user)
|
||||
{
|
||||
if (config('demo.is_enabled')) {
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', 'This feature is disabled');
|
||||
}
|
||||
|
||||
$this->authorize('create', [Ban::class, $user]);
|
||||
|
||||
|
||||
@@ -60,6 +66,12 @@ class BanController extends Controller
|
||||
|
||||
public function delete(Request $request, User $user)
|
||||
{
|
||||
if (config('demo.is_enabled')) {
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', 'This feature is disabled');
|
||||
}
|
||||
|
||||
$this->authorize('delete', $user->bans);
|
||||
|
||||
if ($this->suspensionService->isSuspended($user)) {
|
||||
|
Reference in New Issue
Block a user