Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Commit

Permalink
Removes "testing" environment from authorized environments by default
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Sep 18, 2020
1 parent 8b9cbe5 commit 482f23c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/Http/Middleware/EnsureUserIsAuthorized.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class EnsureUserIsAuthorized
public function handle($request, Closure $next, $guard = null)
{
$allowed = app()->environment('local')
|| app()->environment('testing')
|| Gate::allows('viewVaporUI', [$request->user()]);

abort_unless($allowed, 403);
Expand Down
5 changes: 5 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Tests;

use Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables;
use Illuminate\Support\Facades\Gate;
use Laravel\VaporUi\VaporUiServiceProvider;
use Orchestra\Testbench\TestCase as OrchestraTestCase;

Expand Down Expand Up @@ -32,6 +33,10 @@ protected function getEnvironmentSetUp($app)
$app->useEnvironmentPath(__DIR__.'/..');
$app->bootstrapWith([LoadEnvironmentVariables::class]);

Gate::define('viewVaporUI', function ($user = null) {
return true;
});

$app['config']->set('vapor-ui', require __DIR__.'./../config/vapor-ui.php');

parent::getEnvironmentSetUp($app);
Expand Down

0 comments on commit 482f23c

Please sign in to comment.