• Resolved Howdy_McGee

    (@howdy_mcgee)


    Hello,

    This is just a Feature Request.

    It looks like the admin pages are set with manage_options capability. This is the highest capability a user can have, and only the WordPress Administrator and Site Administrator roles have this.

    Could a filter hook be put in place on the page capabilities here:

    custom-facebook-feed\custom-facebook-feed-admin.php FN cff_menu()

    So that a developer could hook into this and lower the given capability to something other than manage_options? It could look something like this…

    function cff_menu() {
        add_menu_page(
            '',
            'Facebook Feed',
            apply_filters( 'cff_admin_page_cap', 'manage_options', $page = 'toplevel' ),
            'cff-top',
            'cff_settings_page'
        );
        add_submenu_page(
            'cff-top',
            'Settings',
            'Settings',
            apply_filters( 'cff_admin_page_cap', 'manage_options', $page = 'cff-top' ),
            'cff-top',
            'cff_settings_page'
        );
    }
    add_action('admin_menu', 'cff_menu');
    //Add styling page
    function cff_styling_menu() {
        add_submenu_page(
            'cff-top',
            'Customize',
            'Customize',
            apply_filters( 'cff_admin_page_cap', 'manage_options', $page = 'cff-style' ),
            'cff-style',
            'cff_style_page'
        );
    }
Viewing 1 replies (of 1 total)
  • Plugin Support Smash Balloon Joel

    (@joelsmashballoon)

    Hey @howdy_mcgee,

    Thank you for reaching out to us for assistance. There is actually a way you can edit this to be something lower already. As an example you can lower this to edit_posts with the following, or edit it further and add it to your preferred location (usually functions.php of a child theme):

    
    function sb_custom_capability( $cap ) {
        return 'edit_posts';
    }
    add_filter( 'sbi_settings_pages_capability', 'sb_custom_capability', 10, 1 );
    

    The reason it is set so high is due to the nature of the data handled and its protection. Though as we have added more security and encryption to the connection information, we will look over how to edit these permissions in the future. Let me know should you have any additional questions about this.

    Best regards,

Viewing 1 replies (of 1 total)
  • The topic ‘Page Permissions Filter Hook’ is closed to new replies.