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

  • 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, 2014 at 20:46
  • EntryRecord is a child of yii's CActiveRecord. Can I just listen for onAfterFind then?
    – pythic
    Jul 28, 2014 at 20:54

1 Answer 1


You'd have to create a plugin but you could listen for the entries.saveEntry event that is noted here: http://buildwithcraft.com/docs/plugins/hooks-and-events

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

Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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