Expand my Community achievements bar.

SOLVED

Extend/intercept Asset create/delete in new Assets UI

Avatar

Level 2

Hi there,

 

tl;dr: Is there any way to extend/intercept the creation or deletion of an Asset in the new Assets UI and to prevent it based on some conditions?

 

We have 2 requirements:

  • Prevent users from deleting an asset, that is still being used/referenced by a 3rd party integration
  • Prevent users from uploading already existing assets (based on the sha1 hash of the asset, not the same filename in the folder)

Both of those requirements have the need to intercept and to customize the default behavior of uploading and deleting assets. I didn't find any way to achieve this and want to know, if there even is a way to do this synchronously in the new Assets UI (not the "classic" AEM Touch UI).

 

Alternative approaches, we had a look at, which don't satisfy the customer's requirements:

  • Usage of the "Detect duplicate assets" feature: As far as I can see, this is not supported for the new Assets UI and this does not prevent the upload itself (the detection runs asynchronously in the background and only notifies the user in the inbox)
  • Overriding the upload/deletion servlets: This is not recommended to do, and as far as I know isn't even possible for the new Assets UI, all requests are handled by an "/adobe/repository" endpoint, which I don't think we can override or modify in any way (not to say, that this most likely would be extremely hacky and not recommended)
  • Implement some kind of (post-processing) workflow or event-based system: Again, this would only trigger after the asset already has been uploaded or deleted

Does anyone know, if there is a way to modify the default upload/delete behavior or maybe has some alternative ideas?

 

Thanks and best,

Anian

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 5

Hi @webera ,

 

No.
In the new Assets UI, there is no supported way to synchronously intercept or block asset upload or deletion based on custom conditions.

Why

  • Upload/delete is handled by internal /adobe/repository APIs

  • No pre-hooks, no extension points

  • You cannot override or customize this behavior safely

What you can do

Prevent deletion

  • Remove delete permission for users

  • Allow delete only via a custom service/action that checks 3rd-party usage first

Handle duplicate uploads

  • Use workflow / event listener after upload

  • Calculate SHA1

  • Auto-delete or flag duplicates and notify user

 

Conclusion:

 

  • Synchronous blocking in new Assets UI > not supported

  • Use permissions + controlled operations as the practical workaround

Thanks,

Vishal

 

View solution in original post

2 Replies

Avatar

Correct answer by
Level 5

Hi @webera ,

 

No.
In the new Assets UI, there is no supported way to synchronously intercept or block asset upload or deletion based on custom conditions.

Why

  • Upload/delete is handled by internal /adobe/repository APIs

  • No pre-hooks, no extension points

  • You cannot override or customize this behavior safely

What you can do

Prevent deletion

  • Remove delete permission for users

  • Allow delete only via a custom service/action that checks 3rd-party usage first

Handle duplicate uploads

  • Use workflow / event listener after upload

  • Calculate SHA1

  • Auto-delete or flag duplicates and notify user

 

Conclusion:

 

  • Synchronous blocking in new Assets UI > not supported

  • Use permissions + controlled operations as the practical workaround

Thanks,

Vishal

 

Avatar

Level 2

Hi @VishalKa5 ,

 

thanks for the fast response.

I already thought that there is no direct way to solve this. Thanks for the confirmation and also thanks for your input on the alternatives.

 

Best,

Anian