Skip to content

Allow passing extra options to applyScope() #170

@othercorey

Description

@othercorey

When applying a scope to a query, all the available data must be set on the IdentityInterface or user object which can be tedious especially if they conflict with fields in the identity/user.

Can we pass an extra parameter of options to applyScope()?

applyScope(?IdentityInterface $user, string $action, $resource, $options = [])

This would function similar to finders that accept an array of options that can be used to build the query.

An example use case is page-specific overrides to user options that are not persisted to the user. These can be manually applied to the query, however, that adds 2 sets of authorization logic to the same query which can introduce bugs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions