added customer scopes to user model
This commit is contained in:
@@ -83,7 +83,7 @@ class Login extends Controller
|
||||
}
|
||||
|
||||
// Redirect to portal if is customer
|
||||
if ($user->can('read-client-portal')) {
|
||||
if ($user->isCustomer()) {
|
||||
$path = session('url.intended', '');
|
||||
|
||||
// Path must start with company id and 'portal' prefix
|
||||
|
@@ -104,7 +104,7 @@ class Reset extends Controller
|
||||
}
|
||||
|
||||
// Redirect to portal if is customer
|
||||
if ($user->can('read-client-portal')) {
|
||||
if ($user->isCustomer()) {
|
||||
$this->redirectTo = route('portal.dashboard', ['company_id' => $company->id]);
|
||||
}
|
||||
|
||||
|
@@ -121,7 +121,7 @@ class Users extends Controller
|
||||
|
||||
$landing_pages = $u->landing_pages;
|
||||
|
||||
if ($user->can('read-client-portal')) {
|
||||
if ($user->isCustomer()) {
|
||||
// Show only roles with customer permission
|
||||
$roles = Role::all()->reject(function ($r) {
|
||||
return !$r->hasPermission('read-client-portal');
|
||||
|
@@ -26,7 +26,7 @@ class Header
|
||||
|
||||
if (!empty($user)) {
|
||||
// Get customer company
|
||||
if ($user->can('read-client-portal')) {
|
||||
if ($user->isCustomer()) {
|
||||
$company = (object) [
|
||||
'company_name' => setting('company.name'),
|
||||
'company_email' => setting('company.email'),
|
||||
|
Reference in New Issue
Block a user