Disable the Finder module (according to the user ?) and change the way the Assets module works

Hi,

I take the liberty of posting a message because I have two questions regarding the Assets module and the Finder module. I can’t find an answer in the official Cockpit documentation.

If I understood correctly, the Finder module allows you to browse all the folders and files in Cockpit. The Assets module is actually a simplification of the Finder module which only gives access to files stored in /storage/uploads

1 / Is it possible to deactivate the Finder module and only use the Assets module? In the majority of cases, it is not necessary to have access to all Cockpit folders / files directly from Cockpit. Moreover, if an average user uses the Finder module, instead of the Assets module, and deletes an important file / folder for the functioning of Cockpit the application will be down.

2 / Is it possible to change the way the folders / files are stored? Currently, when a file is imported into Cockpit via the Assets module, it is stored in this way on the server:

/storage/uploads/year/month/day/filename.jpg

If we decide to create an Images folder, in the Assets module, and try to import a file into that Images folder … it will actually be stored on the server in the same location.

/storage/uploads/year/month/day/filename.jpg

The folders created in the Assets module are therefore virtual. It would be simpler and more logical for the Assets module to store files in this form:

/storage/uploads/filename.jpg

Or if you want to use an intermediate Images folder

/storage/uploads/images/filename.jpg

In my opinion, it makes no sense that files are stored as year, month, and day. Especially knowing that the Finder module does not work like that. Indeed, when a folder is created via the Finder module, the folder in question is actually created on the server.

Clearly, I really like the interface of the Assets module which is simpler than the Finder module, especially for an average user … but the way files are stored through this module doesn’t seem logical. Looks like the Assets module works like WordPress at this level … whereas Cockpit is not basically a blogging system. Besides, even for a blogging system, I can’t find this way of storing files relevant.

The other problem I see is later when we want to access the files stored on the server from the API-REST … it is easier to say to go and look for the files in /storage/uploads/images, rather than in /storage/uploads/2021/07/13, especially since it is very difficult to remember which file we uploaded and on what date.

What do you think ?

You can define user-group permissions in your config.php. To disable the ‘finder’ module for a group use

{
  groups: {
    noFinderUsers: { // your groups name
      cockpit: {
        finder: false
      }
    }
  }
}

Currently not. This is hardcoded in the assets module