localgovdrupal / localgov_core

LocalGovDrupal Core module, for helper functions and core dependencies.
GNU General Public License v2.0
3 stars 6 forks source link

Hide the 'files' tab to non admins #220

Open markconroy opened 3 months ago

markconroy commented 3 months ago

The files tab is pretty much meaningless to content designers, they need the 'media' tab.

Let's hide it for all, except admin users.

Image

willguv commented 2 months ago

@MariosORION this is related to the tab weights work you've just done, so might be quick for you - thanks

markconroy commented 2 months ago

@willguv we have a PR for this - https://github.com/localgovdrupal/localgov_core/pull/221 - but the other core team members think we should not do this for existing sites.

willguv commented 2 months ago

OK, we should explain how to do it though.

Can it be for new installs?

Is making this change in config a dev job?

markconroy commented 2 months ago

I think it would be good to have it removed for new installs.

For existing sites, it would then mean a developer would have to remove that permission for whatever current roles we don't want it on.

Here's the Merge Tuesday notes for it: https://github.com/localgovdrupal/localgov_core/pull/221#issuecomment-2135025049

MariosORION commented 2 months ago

Thanks both @markconroy, assigning back to @willguv for now.

willguv commented 4 weeks ago

@markconroy Does this remove the ability for content designers to fully delete files? If so, we will need to review

@finnlewis mentioned caching causing problems. Maria at Bracknell Forest mentioned the need to instantly delete files when it's really necessary, and has a fix

@stephen-cox mentioned a setting for how long temporary files are kept. When a file is deleted in Drupal it's marked for deletion and done later

Andy says they have a checkbox for users to select when deleting a media item to delete the underlying files as well

andybroomfield commented 4 weeks ago

Media file delete? (Might be in the default install already).

Image

andybroomfield commented 4 weeks ago

The module is called media file delete

markconroy commented 3 weeks ago

Looks like Media file delete module might be a good addition to our CMS

LizziCBFC commented 3 weeks ago

Maria asked me to add some comments about the file deletion issue we had at Bracknell where files took 6 hours to delete.

On deleting a file, it turned into a 'temporary' file.

This was the comment from WebCurl:

_Temporary files are deleted during cron runs if they're older than 6 hours. (6 hours is the minimum built-in option that Drupal provides). This delay is designed so that newly uploaded files which have not yet been saved to a permanent location are not removed prematurely.

Rather than forcing the delay to be shorter and potentially causing issues, it might be better to make file deletion happen directly instead of changing to temporary and waiting.

The file deletion option is currently provided by a contrib module, https://www.drupal.org/project/file_delete

However, file deletion functionality is also available in Drupal core since 10.1 (making the module essentially obsolete!). I'm not sure which method the core file deletion action uses - if this deletes immediately then I would recommend switching._

Follow up:

Drupal core's file deletion option deletes immediately rather than switching to temporary.

We switched to using that. The only issue was that you can now delete files even when in use under 'media' so you have to be more careful about deleting in-use items.


On another note, I find the files tab really useful as it provides better information such as file type and size.