You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We using canSeeWhen to restrict which actions can bee seen/run for users. But we encountered an issue getting 403 when calling the action. It appears that the policy gets called twice with different models. The first call is done with the correct model object that is loaded from the database. Therefore the user can see and run the action. The second call has an empty model object with only default attributes that is not loaded from the database. Meaning that the exists attribute is set to false. We fixed it by just checking the exists attribute every policy method. But that is an tedious solution. Is this expected behavior.
The text was updated successfully, but these errors were encountered:
Unable to reproduce the issue, please provide full reproducing repository based on fresh installation as suggested in the bug report template (or you can refer to https://github.com/nova-issues for example)
We're closing this issue because it's inactive, already solved, old, or not relevant anymore. Feel free to open up a new issue if you're still experiencing this problem.
Description:
We using
canSeeWhen
to restrict which actions can bee seen/run for users. But we encountered an issue getting 403 when calling the action. It appears that the policy gets called twice with different models. The first call is done with the correct model object that is loaded from the database. Therefore the user can see and run the action. The second call has an empty model object with only default attributes that is not loaded from the database. Meaning that theexists
attribute is set to false. We fixed it by just checking theexists
attribute every policy method. But that is an tedious solution. Is this expected behavior.The text was updated successfully, but these errors were encountered: