tomatophp / filament-media-manager

Manage your media files using spatie media library with easy to use GUI for FilamentPHP
https://tomatophp.com
MIT License
40 stars 7 forks source link

[Feature] Scope Folder to selected users & return folders/media to API #8

Closed mstrihi closed 1 month ago

mstrihi commented 1 month ago

there is any way to assign users to folder / files? when I login to another user I can only see folders / files assigned to me only? and there is any API ready to use?

many thanks

3x1io commented 1 month ago

API/User Base will coming on the next version

mstrihi commented 1 month ago

thank you so much, when you think this release will be available? because I was thinking to use https://filamentphp.com/plugins/ralphjsmit-media-library-manager

3x1io commented 1 month ago

hi, @mstrihi it can be working today. and we are handling our file manager in a different way than Ralph does.

mstrihi commented 1 month ago

Hi @3x1io, thanks for replay. you mean you will publish those changes today?

3x1io commented 1 month ago

Allow User Access

now you can allow user to access selected folder and restract user to access each other folders if the folder is not public on /app/Providers/Filament/AdminPanelProvider.php

->plugin(
    \TomatoPHP\FilamentMediaManager\FilamentMediaManagerPlugin::make()
        ->allowUserAccess()
)

NOTE don't forget to migrate after update the plugin

Folders API

now you can access your media and folders using API you have 2 endpoints

to allow this feature you need to publish the config file by use this command

php artisan vendor:publish --tag="filament-media-manager-config"

then you can set api.active to true on the config file

'api' => [
    "active" => true,
],
mstrihi commented 1 month ago

@3x1io thank you so much what I was meaning, for example admin add folders / files and can assign users for specific folder / file but employee when login for example should only see the folders / files was assign for him only that possible now? many thanks

3x1io commented 1 month ago

https://github.com/user-attachments/assets/cb87f996-575f-4cde-a1d1-4a11e0122c95

yes, it's very easy just edit the folder and select the access.

mstrihi commented 1 month ago

@3x1io thank you so much for your amazing work :) just 1 more question that effect the api as well right? and if I have 2 different tables in DB for users can I override this filed to select from employee instead of users?

thank you