Restricts Library General Access settings to admin#35
Conversation
|
@scottgrayson can you look at this and make sure it is OK with the COE project? |
| * - Change general access (e.g. make items visible to everyone) | ||
| * - Access all library functionality | ||
| * | ||
| * Override this method to add role-based logic. | ||
| * Prefer FilamentLibraryPlugin::isLibraryAdmin() / setLibraryAdminCallback() for | ||
| * authorization. Override this method when host-app code calls it directly. | ||
| */ | ||
| public function isLibraryAdmin(): bool | ||
| { |
There was a problem hiding this comment.
This method needs to be removed from the trait and the docs.
This PR has made the trait authorization method useless, but i think the plugin callback is better.
I updated COE to use the plugin callback. https://github.com/TappNetwork/Communities-of-Excellence/pull/183/changes
Need to update the docs to align with this PR. Remove anything related to trait isLibraryAdmin and replace with the plugin callback.
https://github.com/TappNetwork/Filament-Library/blob/main/PERMISSIONS.md#custom-user-model-integration
Permissions doc is outdated
https://github.com/TappNetwork/Filament-Library/blob/main/README.md#admin-access-configuration-optional
remove: "Note: By default, users have an isLibraryAdmin() method that returns false. You can override this in your User model for custom logic."
Details
Restricts Library "General Access" settings on edit page in "My Documents" to administrators only.