Update can method

This commit is contained in:
René Preuß
2021-03-31 12:15:57 +02:00
parent 7af00cb7ab
commit e60c5a5cd3

View File

@@ -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);
} }
/** /**