mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Restrict admin viewing of invoices to invoices in the same account
This commit is contained in:
parent
82fadab632
commit
879e88dcc3
@ -32,15 +32,16 @@ class Authenticate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($guard=='client'){
|
if($guard=='client'){
|
||||||
|
$invitation_key = session('invitation_key');
|
||||||
|
$account_id = $this->getInvitationAccountId($invitation_key);
|
||||||
|
|
||||||
if(Auth::guard('user')->check()){
|
if(Auth::guard('user')->check() && Auth::user('user')->account_id === $account_id){
|
||||||
// This is an admin; let them pretend to be a client
|
// This is an admin; let them pretend to be a client
|
||||||
$authenticated = true;
|
$authenticated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Does this account require portal passwords?
|
// Does this account require portal passwords?
|
||||||
$invitation_key = session('invitation_key');
|
$account = Account::whereId($account_id)->first();
|
||||||
$account = Account::whereId($this->getInvitationAccountId($invitation_key))->first();
|
|
||||||
if(!$account->enable_portal_password || !$account->isPro()){
|
if(!$account->enable_portal_password || !$account->isPro()){
|
||||||
$authenticated = true;
|
$authenticated = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user