Skip to content

Restricts Library General Access settings to admin#35

Merged
andreia merged 3 commits into
mainfrom
upload_general_access
Jul 22, 2026
Merged

Restricts Library General Access settings to admin#35
andreia merged 3 commits into
mainfrom
upload_general_access

Conversation

@andreia

@andreia andreia commented Jul 17, 2026

Copy link
Copy Markdown
Member

Details

Restricts Library "General Access" settings on edit page in "My Documents" to administrators only.

@andreia
andreia requested a review from swilla July 17, 2026 01:26
@swilla
swilla requested a review from scottgrayson July 17, 2026 01:53
@swilla

swilla commented Jul 17, 2026

Copy link
Copy Markdown
Member

@scottgrayson can you look at this and make sure it is OK with the COE project?

Comment thread src/Traits/LibraryUser.php Outdated
Comment on lines 47 to 54
* - 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
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."

@andreia
andreia requested a review from scottgrayson July 22, 2026 00:49
@andreia
andreia merged commit a71142b into main Jul 22, 2026
9 checks passed
@andreia
andreia deleted the upload_general_access branch July 22, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants