mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Adjustments for mini_load
This commit is contained in:
parent
ada3c78556
commit
742d566f27
@ -516,19 +516,11 @@ class BaseController extends Controller
|
|||||||
$query->where('bank_transactions.user_id', $user->id);
|
$query->where('bank_transactions.user_id', $user->id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'company.bank_transaction_rules'=> function ($query) use ($updated_at, $user) {
|
'company.bank_transaction_rules'=> function ($query) {
|
||||||
$query->where('updated_at', '>=', $updated_at);
|
$query->whereNotNull('updated_at');
|
||||||
|
|
||||||
if (! $user->isAdmin() && !$user->hasIntersectPermissions(['create_bank_transaction','edit_bank_transaction','view_bank_transaction'])) {
|
|
||||||
$query->where('bank_transaction_rules.user_id', $user->id);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
'company.task_schedulers'=> function ($query) use ($updated_at, $user) {
|
'company.task_schedulers'=> function ($query) {
|
||||||
$query->where('updated_at', '>=', $updated_at);
|
$query->whereNotNull('updated_at');
|
||||||
|
|
||||||
if (! $user->isAdmin()) {
|
|
||||||
$query->where('schedulers.user_id', $user->id);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
@ -656,24 +648,6 @@ class BaseController extends Controller
|
|||||||
return $this->response($this->manager->createData($resource)->toArray());
|
return $this->response($this->manager->createData($resource)->toArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* In case a user is not an admin and is
|
|
||||||
* able to access multiple companies, then we
|
|
||||||
* need to pass back the mini load only
|
|
||||||
*
|
|
||||||
* @deprecated
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
// private function complexPermissionsUser(): bool
|
|
||||||
// {
|
|
||||||
// //if the user is attached to more than one company AND they are not an admin across all companies
|
|
||||||
// if (auth()->user()->company_users()->count() > 1 && (auth()->user()->company_users()->where('is_admin', 1)->count() != auth()->user()->company_users()->count())) {
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Passes back the miniloaded data response
|
* Passes back the miniloaded data response
|
||||||
*
|
*
|
||||||
|
@ -34,7 +34,7 @@ use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundExceptio
|
|||||||
* @property int $company_id
|
* @property int $company_id
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property int $user_id
|
* @property int $user_id
|
||||||
* @property int @assigned_user_id
|
* @property int $assigned_user_id
|
||||||
* @property \App\Models\Company $company
|
* @property \App\Models\Company $company
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel|Illuminate\Database\Eloquent\Relations\BelongsTo|\Awobaz\Compoships\Database\Eloquent\Relations\BelongsTo|\App\Models\Company company()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel|Illuminate\Database\Eloquent\Relations\BelongsTo|\Awobaz\Compoships\Database\Eloquent\Relations\BelongsTo|\App\Models\Company company()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel|Illuminate\Database\Eloquent\Relations\HasMany|BaseModel orderBy()
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel|Illuminate\Database\Eloquent\Relations\HasMany|BaseModel orderBy()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user