Fix Model Policies from matching user_id's and account_id's, and other minor cosmetic fixes

This commit is contained in:
Deon George
2021-09-29 16:20:22 +10:00
parent f7439172b6
commit 4243da9c32
14 changed files with 173 additions and 172 deletions

View File

@@ -330,14 +330,14 @@ class User extends Authenticatable
/* GENERAL METHODS */
/**
* Determine if the user is an admin of the account with $id
* Determine if the user is an admin of the user with $id
*
* @param $id
* @return bool
*/
public function isAdmin($id): bool
{
return $id AND $this->isReseller() AND in_array($id,$this->all_accounts()->pluck('id')->toArray());
return $id AND $this->isReseller() AND in_array($id,$this->all_accounts()->pluck('user_id')->toArray());
}
/**