Skip to content

bug: ResourceQuery::authorizeResource must return bool but Authorizer::index returns Response #299

Closed
@paul-thebaud

Description

@paul-thebaud

Description

There is currently a bug with ResourceQuery::authorizeResource(), which is strict typed to return a bool value.
But, if we check the Authorizer::index() method (and other methods like it), it can return bool or Response.

Since Laravel default gate always returns a Response object, this results in a 500 error.

Env

  • Laravel version: v11.34.2
  • laravel-json-api/core version: v4.3.0

Notes

This is due to the updated Authorizer implementation in the core package, which now uses inspect instead of check. IMO, ResourceQuery and any other code which uses Authorizer methods should be updated in consequence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions