Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to execute a custom function on the entry crud methods? Basically what I want to achieve is that a CP user with certain field value cannot read or save an entry that doesn't have the same field value. (in this case company) Are there any hooks/events available on that level? On group permission level I just want all permissions set to allow on that section.

Thanks in advance

share|improve this question
What i'm interested in (been browsing in the code a but but didn't find anything) is there an event raised after reading or validating the entry? So I can decide last minute to show the entry or not based on custom criteria . Thanks – pythic Jul 28 '14 at 20:46
EntryRecord is a child of yii's CActiveRecord. Can I just listen for onAfterFind then? – pythic Jul 28 '14 at 20:54

You'd have to create a plugin but you could listen for the entries.saveEntry event that is noted here:

Then lookup the value, run validation and even return a custom error message if things were not saved correctly.

Hope this helps.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.