Prevent assets from being created Trigger

Matrix Version: 5.5.4.2

Hi all,

I’ve been trying to come up with a solution to limit where users can create assets (images + docs mainly), and have stumbled across this tutorial which seems to no longer be a viable solution due to there no longer being a Fail trigger action:

https://matrix.squiz.net/tutorials/2015/configuring-a-trigger-to-prevent-image-assets-from-being-created

Is there a new way to do this? Or what other ways have people come up with to manage this?

Cheers,
Brad.

Hi Brad,

The name of that particular trigger action was updated in Matrix 5.4.4.0, and is now called Trigger Log Message.

You can find a bit more info about the change, and that trigger action, in the following links:

Release notes: https://matrix.squiz.net/releases/5.4/5.4.4.0#new-features-enhancements_improved-custom-error-and-log-handling-trigger-action

Trigger Action Manuals: https://matrix.squiz.net/manuals/triggers/chapters/trigger-actions#trigger-log-message

Cheers,

Tyson

Thanks for the quick reply Tyson.

The Trigger Log Message has a note saying “Messages are only shown in the Admin ( /_admin ) interface and not in the Edit+ ( /_edit ).” Based on this, what would be the best way to notify a user who is in the Edit interface that the action has been blocked? I assume one way would be to set up an email to be sent, but are there any options for a quicker notification?

Cheers.

Not a worry at all.

The quickest way off the top of my head would be to also run the Redirect to URL (https://matrix.squiz.net/manuals/triggers/chapters/trigger-actions#Redirect-to-URL) trigger and take the user to some basic page asset with a message indicating that they are unable to create those assets. The downside to this strategy is that they are taken away from the _edit interface so that may not be suitable for you.

I imagine (and hope) someone else has a better solution for you.

Cheers

Hi Brad,

You always have the option to create a custom Edit+ plugin.
For more information on ‘JavaScript Plugins’, please check out the following manual page, https://matrix.squiz.net/manuals/edit-plus/chapters/javascript-plugins

Theres a few examples of them here that might give you an idea of how to achieve what you are after: - https://matrix.squiz.net/tutorials/topics/edit-plus

Just be aware, a plugin might need to be re-implemented or not work at all after an upgrade.

Happy hunting