From b0cbf65cfc62d37dddb13045280a433bce8cf0ec Mon Sep 17 00:00:00 2001 From: Miguel Nogueira Date: Mon, 31 Aug 2020 17:55:36 +0100 Subject: [PATCH] Added missing permissions to roles --- app/Http/Controllers/OptionsController.php | 7 +++++-- database/seeds/NewPermissions.php | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/OptionsController.php b/app/Http/Controllers/OptionsController.php index c8860ed..9c9cb65 100644 --- a/app/Http/Controllers/OptionsController.php +++ b/app/Http/Controllers/OptionsController.php @@ -3,6 +3,8 @@ namespace App\Http\Controllers; use App\Helpers\Options; +use App\Options as Option; + use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; @@ -15,11 +17,12 @@ class OptionsController extends Controller */ public function index() { - $options = Options::all(); + // TODO: Obtain this from the facade + $options = Option::all(); return view('dashboard.administration.positions') - ->with('options'); + ->with('options', $options); } public function saveSettings(Request $request) diff --git a/database/seeds/NewPermissions.php b/database/seeds/NewPermissions.php index 331d13c..cc8b484 100644 --- a/database/seeds/NewPermissions.php +++ b/database/seeds/NewPermissions.php @@ -17,10 +17,14 @@ class NewPermissions extends Seeder 'name' => 'developer' ]); + $admin = Role::where('name', 'admin')->first(); + Permission::create(['name' => 'admin.settings.view']); Permission::create(['name' => 'admin.settings.edit']); $developer->givePermissionTo('admin.developertools.use'); + $admin->givePermissionTo('admin.settings.view'); + $admin->givePermissionTo('admin.settings.edit'); }