craft-fab-permissions icon indicating copy to clipboard operation
craft-fab-permissions copied to clipboard

Bypass field restrictions when saving entry

Open goraxan opened this issue 3 years ago • 0 comments

My use case is a user which creates user invitation entries, which have a randomly generated activation code (among other fields like email, firstname, lastname,...). This activation code should be hidden from the user, but it should be randomly generated and saved when creating the invitation. Setting that field in the EVENT_BEFORE_SAVE has no effect since the creating user is not allowed to access that field.

I'm wondering if it's somehow possible to programmatically set restricted fields with a plugin/module when saving an entry.

Thanks

goraxan avatar Aug 04 '20 09:08 goraxan