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
/** * The relationships that should be eager loaded on index queries. * * @var array */publicstatic$with = ['routes'];
...
public functionactions(NovaRequest $request)
{
return [
(newActions\MessagesExport())->onFailure(function() {
return Action::danger('Oh dear! I could not create that export for you.');
})→askForFilename(),
ExportAsCsv::make()->nameable()
];
}
...
RoutesPolicy is equal to MessagePolicy
There are 2 roles: Administrator and Client.
Client has no rights for editing or deleting record but has to have possibility to export data.
Export works only with Administrator role. With Client role after click the Export action nothing happens (no request to the server). No errors in the console as well.
I tried to use built-in Nova class ExportAsCsv and library aatwebsite Laravel Nova Excel and got the same result.
The documentation says (https://nova.laravel.com/docs/4.0/resources/authorization.html#undefined-policy-methods) if there is no methods for specific action Nova would use default extension. At the same time, there is a priority of methods (https://nova.laravel.com/docs/4.0/actions/registering-actions.html#authorization-via-resource-policy).
Considering that with Administrator role everything works I can suppose thet priority is broken and action is prohibited based on methods update and delete insted of using methods runAction and runDestructiveAction.
Could you help me with this issue?
This discussion was converted from issue #4940 on October 18, 2022 14:19.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Model policy:
Nova model:
…
RoutesPolicy is equal to MessagePolicy
There are 2 roles: Administrator and Client.
Client has no rights for editing or deleting record but has to have possibility to export data.
Export works only with Administrator role. With Client role after click the Export action nothing happens (no request to the server). No errors in the console as well.
I tried to use built-in Nova class ExportAsCsv and library aatwebsite Laravel Nova Excel and got the same result.
The documentation says (https://nova.laravel.com/docs/4.0/resources/authorization.html#undefined-policy-methods) if there is no methods for specific action Nova would use default extension. At the same time, there is a priority of methods (https://nova.laravel.com/docs/4.0/actions/registering-actions.html#authorization-via-resource-policy).
Considering that with Administrator role everything works I can suppose thet priority is broken and action is prohibited based on methods update and delete insted of using methods runAction and runDestructiveAction.
Could you help me with this issue?
Beta Was this translation helpful? Give feedback.
All reactions