Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make administrator model compatible to authorizable interface #1718

Merged
merged 1 commit into from
Sep 7, 2022

Conversation

s5w95
Copy link
Contributor

@s5w95 s5w95 commented Apr 10, 2022

Some packages which uses the Spatie-Permissions like Spati-Mailcoach require a Administrator Model which is compatible with the Authorizable Interface.

You get this error then:
"Spatie\Permission\PermissionRegistrar::Spatie\Permission{closure}(): Argument #1 ($user) must be of type Illuminate\Contracts\Auth\Access\Authorizable, Dcat\Admin\Models\Administrator given"

As a solution I need to copy the whole model and HasPermission Trait to make it compatible, because you cannot simply override the "can" method. This is a very ugly solution, because I need to track changes on the Administrator model and the HasPermission Trait on dcat-updates.

This PR makes the Administrator Model compatible with the Authorizable Interface. Very simple changes nothing with impact. Not sure if you want to add this PR, maybe its a nice to have if some Spatie-Admin-Tools (or others) are compatible without problems.

@jqhph jqhph merged commit 7e426e9 into jqhph:2.0 Sep 7, 2022
@jqhph
Copy link
Owner

jqhph commented Sep 7, 2022

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants