• Resolved webheadcoder

    (@webheadllc)


    Hi,

    I’m not sure what changed, but I used to be able to view the URI Editor with an “Editor” user and now I’m not able to. I do not see it in the menu when logged in as an “Editor”. Visiting the Permalink Manager url directly shows the “Sorry, you are not allowed to access this page” message. I also tried it on a fairly clean site and I still cannot access the page. Below are my settings from the Debug tab. Thanks.

    <span style="font-size: 14.4px;">Array
    (
        [screen-options] => Array
            (
                [per_page] => 20
                [post_statuses] => Array
                    (
                        [0] => publish
                    )
    
                [group] => 
            )
    
        [general] => Array
            (
                [auto_update_uris] => 0
                [force_custom_slugs] => 0
                [trailing_slashes] => 0
                [partial_disable] => Array
                    (
                        [post_types] => Array
                            (
                                [0] => attachment
                                [1] => tribe_events
                            )
    
                    )
    
                [ignore_drafts] => 1
                [canonical_redirect] => 1
                [old_slug_redirect] => 0
                [trailing_slashes_redirect] => 0
                [copy_query_redirect] => 1
                [sslwww_redirect] => 0
                [redirect] => 301
                [fix_language_mismatch] => 1
                [wpml_support] => 1
                [pmxi_support] => 1
                [um_support] => 1
                [yoast_breadcrumbs] => 0
                [primary_category] => 1
                [show_native_slug_field] => 0
                [partial_disable_strict] => 1
                [pagination_redirect] => 0
                [disable_slug_sanitization] => 0
                [keep_accents] => 0
                [edit_uris_cap] => publish_pages
                [auto_fix_duplicates] => 0
                [setup_redirects] => 0
                [extra_redirects] => 1
                [trailing_slash_redirect] => 0
            )
    
    )
    </span>
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Maciej Bis

    (@mbis)

    Hi @webheadllc,

    Actually, only users with roles that have the “Tools -> Permalink Manager” capability may access the “manage_options” and this has been the case since the beginning.

    If you would like to allow Editors access the Bulk URI Editor, please use the below code snippet:

    function pm_show_tools_uri_editor($options) {
    	global $permalink_manager;
    
    	if(current_user_can('editor') && !empty($permalink_manager)) {
    		$admin_functions_class = $permalink_manager->functions['admin-functions'];
    
    		remove_action( 'admin_menu', array($admin_functions_class, 'add_menu_page') );
    
    		add_management_page( __('Permalink Manager', 'permalink-manager'), __('Permalink Manager', 'permalink-manager'), 'edit_pages', PERMALINK_MANAGER_PLUGIN_SLUG, array($admin_functions_class, 'display_section') );
    
    		add_action( 'admin_init', array($admin_functions_class, 'enqueue_styles' ) );
    		add_action( 'admin_init', array($admin_functions_class, 'enqueue_scripts' ) );
    
    		add_filter('permalink_manager_sections', 'pm_hide_tools_admin_sections', 100);
    	}
    }
    add_action('admin_menu', 'pm_show_tools_uri_editor', 0);
    
    /**
    ?* Hide Permalink Manager "Tools", "Settings", "Debug" & "Permastructure" tabs
    ?*/
    function pm_hide_tools_admin_sections($sections) {
    	return array('uri_editor' => $sections['uri_editor']);
    }

    This should make the URI Editor available also for Editors:

    Best regards,
    Maciej

    Thread Starter webheadcoder

    (@webheadllc)

    Oh ok. Thank you for the quick reply and code!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Not able to see the URI Editor Page’ is closed to new replies.