mirror of
https://github.com/bitinflow/accounts.git
synced 2026-03-18 07:55:53 +00:00
Update can method
This commit is contained in:
@@ -31,11 +31,9 @@ trait HasBitinflowTokens
|
|||||||
*/
|
*/
|
||||||
public function bitinflowTokenCan(string $scope): bool
|
public function bitinflowTokenCan(string $scope): bool
|
||||||
{
|
{
|
||||||
if (in_array('*', $this->accessToken->scopes)) {
|
$scopes = $this->accessToken ? $this->accessToken->scopes : [];
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->accessToken ? in_array($scope, $this->accessToken->scopes) : false;
|
return in_array('*', $scopes) || in_array($scope, $this->accessToken->scopes);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user