Added missing permissions to roles

This commit is contained in:
Miguel Nogueira 2020-08-31 17:55:36 +01:00
parent 6be5e241d4
commit b0cbf65cfc
2 changed files with 9 additions and 2 deletions

View File

@ -3,6 +3,8 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Helpers\Options; use App\Helpers\Options;
use App\Options as Option;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
@ -15,11 +17,12 @@ class OptionsController extends Controller
*/ */
public function index() public function index()
{ {
$options = Options::all(); // TODO: Obtain this from the facade
$options = Option::all();
return view('dashboard.administration.positions') return view('dashboard.administration.positions')
->with('options'); ->with('options', $options);
} }
public function saveSettings(Request $request) public function saveSettings(Request $request)

View File

@ -17,10 +17,14 @@ class NewPermissions extends Seeder
'name' => 'developer' 'name' => 'developer'
]); ]);
$admin = Role::where('name', 'admin')->first();
Permission::create(['name' => 'admin.settings.view']); Permission::create(['name' => 'admin.settings.view']);
Permission::create(['name' => 'admin.settings.edit']); Permission::create(['name' => 'admin.settings.edit']);
$developer->givePermissionTo('admin.developertools.use'); $developer->givePermissionTo('admin.developertools.use');
$admin->givePermissionTo('admin.settings.view');
$admin->givePermissionTo('admin.settings.edit');
} }