@supaiku
Hi there,
I am 100% with you on them having to have informed us regarding the change and hopefully, if this DOES change again in a future update, they will let us know. But they have apologized for this and stated that they will keep the community informed. This is a feature I’m still hoping they build in to NF’s core settings settings.
I genuinely hope the method I’m going to describe below will help you, because I am not a coder I wouldn’t know how to fix it if it does in fact change again!
As far as I know the code can be put into your theme’s functions.php file, but because I use Oxygen Builder, I use the Code Snippets plugin. I also use Publishpress Permissions for capability settings.
I add a capability in Publishpress Permissions called ‘access_forms’, so in my code below, change that to your desired capability:
I add a new Code Snippet and paste this into it:
// Must use all three filters for this to work properly.
add_filter( 'ninja_forms_admin_parent_menu_capabilities', 'nf_subs_capabilities' ); // Parent Menu
add_filter( 'ninja_forms_admin_all_forms_capabilities', 'nf_subs_capabilities' ); // Forms Submenu
add_filter( 'ninja_forms_admin_submissions_capabilities', 'nf_subs_capabilities' ); // Submissions Submenu
function nf_subs_capabilities( $cap ) {
return 'access_forms'; // EDIT: User Capability
}
/**
* Filter hook used in the API route permission callback to retrieve submissions
*
* return bool as for authorized or not.
*/
add_filter( 'ninja_forms_api_allow_get_submissions', 'nf_define_permission_level', 10, 2 );
add_filter( 'ninja_forms_api_allow_delete_submissions', 'nf_define_permission_level', 10, 2 );
add_filter( 'ninja_forms_api_allow_update_submission', 'nf_define_permission_level', 10, 2 );
add_filter( 'ninja_forms_api_allow_handle_extra_submission', 'nf_define_permission_level', 10, 2 );
add_filter( 'ninja_forms_api_allow_email_action', 'nf_define_permission_level', 10, 2 );
function nf_define_permission_level() {
$allowed = \current_user_can("access_forms");
return $allowed;
};
VERY IMPORTANT: If you are using Code Snippets, set it to run everywhere!
I really hope this helps you!!