allowed login models and update of login controller

This commit is contained in:
2019-01-09 01:01:18 -06:00
parent ffe57b1bcd
commit cfaefb2bfd

View File

@@ -20,14 +20,14 @@ class RequireRole
{
$confirmed = false;
$ranking = [
'None' => 0,
'Guest' => 1,
'User' => 2,
'Director' => 3,
'Admin' => 4,
'role.none' => 0,
'role.guest' => 1,
'role.user' => 2,
'role.director' => 3,
'role.admin' => 4,
];
//Using eloquent let's get the roles for the character
$check = UserRole::where('character_id', auth()->user()->character_id)->get(['role']);
$check = UserPermission::where(['character_id' => auth()->user()->character_id, 'permission' => $permission])->get(['permission']);
if(!isset($check[0]->role)) {
abort(403, "You don't have permissions to access this area!");