Non _admin asset deletion?


(Douglas (@finnatic at @waikato)) #1

While reviewing an asset builder and listing of assets with a colleague they noted there was no easy way to remove assets from the listing.

 

It's easy enough to craft preview or edit links into an asset listing - is there a way to do deletion of assets from an asset listing rather than requiring _admin access?  Anyone got code they'd like to share if they've implemented something that achieves this?


(Joel Porgand) #2

Should be pretty simple to create a little button in your asset listing, set up a click listener for it & have it call the JS API to nuke the asset.


(Nic Hubbard) #3

Or create an Asset Accessed trigger with a few conditions (things like GET, contains string, etc). Then use JS to call that URL. Have done this in the past as it is much quicker to setup than the JS API if you are not familiar with it.