Issuing rights to upload to the media library

Good afternoon! Tell me how to give the right dip for the defined role to upload files / images to the media library? Gate::define('list', function ($user) { return $this->authorize($user, function ($user) { return $this->userHasRole($user, [ UserRole::MANAGER, ]); }); }); Gate::define('upload', function ($user) { return $this->authorize($user, function ($user) { return $this->userHasRole($user, [ UserRole::MANAGER, ]); }); }); The media library has appeared in the menu and the download button is also displayed. But when uploading an image or file, it writes XHR returned response code 403
2 Replies
ifox
ifox2y ago
GitHub
twill/MediaLibraryController.php at af7ccd671799ebe0f1cd80b506f7a31...
Twill is an open source CMS toolkit for Laravel that helps developers rapidly create a custom admin console that is intuitive, powerful and flexible. Chat with us on Discord at https://discord.gg/c...
ifox
ifox2y ago
I see that there is an inconsistent setup here. The upload permission is controlling the frontend rendering of the ability to upload, but then the post routes to upload are bound to the edit permission. I assume you do not want to give edit permission to those users
Want results from more Discord servers?
Add your server