mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Fixed tests
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
c604f08749
commit
ab3b5ca4ef
|
@ -131,7 +131,7 @@ final class Company extends SnipeModel
|
||||||
public static function isCurrentUserHasAccess($companyable)
|
public static function isCurrentUserHasAccess($companyable)
|
||||||
{
|
{
|
||||||
// When would this even happen tho??
|
// When would this even happen tho??
|
||||||
if (is_null($companyable)) {
|
if (!$companyable) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,16 @@ abstract class SnipePermissionsPolicy
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If we got here by $this→authorize('something', $actualModel) then we can continue on Il but if we got here
|
||||||
|
* via $this→authorize('something', Model::class) then calling Company:: isCurrentUserHasAccess($item) gets weird.
|
||||||
|
* Bail out here by returning "nothing" and allow the relevant method lower in this class to be called and handle authorization.
|
||||||
|
*/
|
||||||
|
if (!$item instanceof Model){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Company::isCurrentUserHasAccess() method from the company model handles the check for FMCS already so we
|
* The Company::isCurrentUserHasAccess() method from the company model handles the check for FMCS already so we
|
||||||
* don't have to do that here.
|
* don't have to do that here.
|
||||||
|
|
Loading…
Reference in a new issue