To Create a postfunction follow this guide
How to add a post function
and then Choose Update Confluence Page Permission
Filling the form
1. Choose a Page Customfield
Choose a page customfield where the value reflects the Confluence page intended to have its permissions updated
Choose what restriction should be applied
Please refer to Confluence documentation to learn more about Page Restrictions
3. Restriction Details
You may add Users, Groups and User Customfields to your update function
Editing Restricted
You have to specify who can edit
Viewing and Editing Restricted
You have to specify who can view and edit and who can view only
4. Run as User
Leaving this field empty would run this action as the current user (Logged in User), and you may specify to run the action as
Global Confluence Admin or as user from user picker search