Take the 2-minute tour ×
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.

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

share|improve this answer

Your Answer

 
discard

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.