As in the subject, after having developed a custom model with associated behavior, I am looking for an "official" way to achieve this:
1) Apply aspect
2) Check if requisites are met (i.e. only cm:content, specific mime type...etc)
3) Prevent aspect from being added if necessary
4) Inform the user with a custom localized message that something went wrong
I followed many tutorial about custom behavior and policy, but I couldn't find a suitable example covering the subject.
I mean, most of them cover the policy onAddAspect and onRemoveAspect, but there's nothing related to the points above.
For the moment I am just throwing an error in beforeAddAspect policy, but seems not so much elegant.
If this matter, I am using Community 4.2.f.