From 133d6ffa50cf4ee0832008f3f6050fcf7c3bf9c6 Mon Sep 17 00:00:00 2001 From: akemidx Date: Thu, 15 Dec 2022 15:18:24 -0500 Subject: [PATCH 1/2] Commenting on a scope in Models/Company.php --- app/Models/Company.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Models/Company.php b/app/Models/Company.php index 83b6a0670..273a02ad0 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -73,6 +73,10 @@ final class Company extends SnipeModel } } + /** + * Adding scope to table queires, where only authorized users will be able to see a company's ID value + * + */ private static function scopeCompanyablesDirectly($query, $column = 'company_id', $table_name = null) { if (Auth::user()) { From 94afe2bc6ae8dbaa8471803e9914a7b1ab158842 Mon Sep 17 00:00:00 2001 From: akemidx Date: Mon, 19 Dec 2022 14:48:43 -0500 Subject: [PATCH 2/2] edits & typo fixes --- app/Models/Company.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/Company.php b/app/Models/Company.php index 273a02ad0..413011b9a 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -74,8 +74,8 @@ final class Company extends SnipeModel } /** - * Adding scope to table queires, where only authorized users will be able to see a company's ID value - * + * Scoping table queries, determining if a logged in user is part of a company, and only allows + * that user to see items associated with that company */ private static function scopeCompanyablesDirectly($query, $column = 'company_id', $table_name = null) {