Set field value on create of an entry

#1

I would want to put the name of the user in a field on create of the entry. Does the Cockpit have such a function? I tried to look for it, but haven’t found anything. I also tried to change the permissions somehow, but I couldn’t figure out how to access the entry from a custom permission. Thank you for reply.

#2

I found the solution. I wrote in custom create permissions this:

$context->entry['<name of the field>'] = $context->user['user'];