cancel
Showing results for 
Search instead for 
Did you mean: 

Prohibit Deletion via Rules/Behaviour

manish
Champ in-the-making
Champ in-the-making
I want to prohibit deletion of any  file inside a specific folder of any level of user. Is it possible to implement it through Rules/action or through custom behavior? If yes - how can I do this??? I know about adding/configuring behaviors - just want to know how to stop "deletion" and what event/trigger I can trap?

Any pointers, help would be highly appreciated!

TIA,
- Manish
P.S. I don't want to do it with permissions, so please suggest behavior/action route only!
3 REPLIES 3

mrogers
Star Contributor
Star Contributor
Yes you can just throw an exception from a behaviour.

Make sure that the behavior is triggered within the transaction and not post-commit.

Not nice, but it works!

manish
Champ in-the-making
Champ in-the-making
I contemplated throwing exception, but thought it was very crude. No other clean way to implement this? On which event I can try this in behaviour? It is possible that deletion may take place from CIFS as well, so will this approach work in that case?

mrogers
Star Contributor
Star Contributor
I agree that its not nice.

A cleaner way is not to present actions that you can't do in the first place.    But over a filesystem protocol like CIFS there's not a lot of choice of what you can and can't do.