• tommcgee

    (@tommcgee)


    What specific permissions are needed for map creation and editing? We’re running a multi-site installation, and it seems as though the “editor” role doesn’t have enough permissions. I had to set everyone as an “administrator” for the specific blog, which I’d rather not have to do.

Viewing 1 replies (of 1 total)
  • Bradypus

    (@clementgalliot)

    Hello, I found a solution to make the plugin accessible to roles other than the administrator, via the Members plugin but this requires modifying a AcuGIS Leaflet Maps plugin function (mapfig_premium_mf_menu() in “lib/controller.php” precisely)

    https://justintadlock.com/archives/2009/09/18/custom-capabilities-in-plugins-and-themes

    I put this on mine :

    function mapfig_premium_mf_menu() {
    	
    	/* Add capability */
    	if ( function_exists( 'members_plugin_init' ) )
    	add_filter( 'map_capability', 'edit_maps' );
    
    	function unique_maps_capability( $cap ) {
    		return 'edit_maps';
    	}
    	/* -------------- */
    	
    	add_menu_page(MF_PLUGIN_NAME_FORMATED, '<i class="fa fa-leaf fa-2"></i> Maps', unique_maps_capability( $cap ), MF_PLUGIN_NAME, 'mf','dashicons-admin-mediaa');
    	
    	add_submenu_page( MF_PLUGIN_NAME, 'My Maps', '<i class="fa fa-globe"></i> My Maps', unique_maps_capability( $cap ), 'my-maps', 'mf_main_map' );
    	add_submenu_page( MF_PLUGIN_NAME, 'Manage Map', '<i class="fa fa-location-arrow"></i> Add New Map<hr>', unique_maps_capability( $cap ), 'add-new-map', 'add_main_map' );
    	add_submenu_page( MF_PLUGIN_NAME, 'My Base Maps', '<i class="fa fa-align-justify"></i> My Base Maps', 'administrator', 'layers', 'layers' );
    	add_submenu_page( MF_PLUGIN_NAME, 'Add New Base Map', '<i class="fa fa-plus-square"></i> Add New Base Map', 'administrator', 'layers-add', 'layers_add' );
    	add_submenu_page( MF_PLUGIN_NAME, 'Base Map Groups', '<i class="fa fa-group"></i> Base Map Groups', 'administrator', 'groups', 'groups' );
    	add_submenu_page( MF_PLUGIN_NAME, 'Add New Group', '<i class="fa fa-plus-square"></i> Add New Group<hr>', 'administrator', 'groups-add', 'groups_add' );
    
    	add_submenu_page( MF_PLUGIN_NAME, 'Social Share', '<i class="fa fa-share"></i> Social Share', 'administrator', 'social-share', 'social_share' );
    	add_submenu_page( MF_PLUGIN_NAME, 'Social Share', '<i class="fa fa-cog"></i> Social Settings<hr>', 'administrator', 'social-share-settings', 'social_share_settings' );
    	add_submenu_page( MF_PLUGIN_NAME, 'Widget', '<i class="fa fa-user-plus"></i> Widget<hr>', 'administrator', 'get_started_widget', 'get_started_widget' );
    
    	add_submenu_page( MF_PLUGIN_NAME, 'Documentation', '<i class="fa fa-book"></i> Documentation', 'administrator', 'get-started', 'get_started' );
    }

    and I create a role capability named edit_maps in Members role settings

    I hope it can help !

Viewing 1 replies (of 1 total)
  • The topic ‘Question about permissions’ is closed to new replies.