More improvements to User Switch
This commit is contained in:
@@ -18,7 +18,7 @@ class AdminController extends Controller
|
||||
|
||||
public function switch_authorised()
|
||||
{
|
||||
return TRUE;
|
||||
return Auth::user()->isAdmin ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
public function switch_session()
|
||||
|
@@ -9,7 +9,12 @@ use Session;
|
||||
|
||||
trait UserSwitch
|
||||
{
|
||||
public function switched()
|
||||
public function GetIsAdminAttribute()
|
||||
{
|
||||
return isset($this->admin) ? $this->admin : FALSE;
|
||||
}
|
||||
|
||||
public function getSwitchedAttribute()
|
||||
{
|
||||
return Session::get('orig_user');
|
||||
}
|
||||
|
Reference in New Issue
Block a user