This is something you can achieve with the Advanced Custom Fields plugin. The trick is to use the ACF_LITE
mode, which would let you define a dynamic list of user profile fields from functions.php
. You could iterate over each post type and display a checkbox for it. Then use the edit_user_profile_update
hook to call $user->add_cap('edit_[resource]')
or $user->remove_cap('edit_[resource]')
, etc.