This module works smooothly! I would've liked an option to lock files by their file type, so I quickly parsed that together.

Since there is no simple 'type' column in the {file_managed} table in core, I took the liberty to use the File Entity module for checking that (since it adds the 'type' column there). So if File Entity is enabled, there will be new "Lock files by type" option at the admin page. Patch included.

CommentFileSizeAuthor
file_lock-lock-by-filetype.patch2.98 KBisampo

Comments

rozh’s picture

Issue summary: View changes

Very useful feature! Since regular expression can be very painful for novices. Thank you!

thepanz’s picture

Can this feature be performed by a submodule using the new hook defined in #2094157: Add hook_file_lock_alter() to allow other modules to employ arbitrary logic?