-
Notifications
You must be signed in to change notification settings - Fork 34
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
Authorizable method_exists vs is_callable #1147
Comments
I'm not sure what you're asking us to change inside of Nova. Please post a new issue if you can reproduce an issue inside of it. Thanks! |
@davidhemphill before I dive into investing time in preparing a pull request, I wanted to have some discussion about the issue. Nova's My team has implemented most our policy logic in a custom But when it came to relationships ( We want to trick Nova But I just did some research just now, and there's a problem with that: So a more sophisticated / different solution is required, if it's worth the effort. Bottom line
So we want to implement this in a dynamic way within our What does the Nova team think? Is the problem worth solving? Can we have a discussion about how to solve it? After some discussion and a clear idea of how it should work I'd be happy to submit a pull request. |
Hello guys. I'm in the same situation that @jehoshua02 say. Thanks in advance |
My team has all our policies extending an abstract policy that does some generic permission checking.
Then we ran into issues trying to lock down relationship modifications in a similarly generic fashion. To lock down a single relationship, we have to:
This seems very tedious when we want to lock down relationships by default and open them up one at a time using our permission system.
If we could magically implement attach / detach methods in the abstract class, all our problems would be solved.
Digging into source code I notice that our issue is caused by the Authorizable trait using
method_exists
which makes it impossible to magically program attach and detach methods.Could this be easily updated to use
is_callable
instead? Or is there a reason for usingmethod_exists
?Many thanks! Great framework!
The text was updated successfully, but these errors were encountered: