Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi Ahia,

    You can edit the file “UPCP_Main.php”, and put in a different role for the plugin menus, if that would be easier for you.

    Thread Starter ahiaruhe

    (@ahiaruhe)

    Thanks, that works but then admin can’t see it. Can I have both ‘editor’ and ‘administrator’? I tried it but it didn’t work.

    Thanks a lot – love this plugin, and appreciate all the development you’ve been doing. I have a license for one site, I will buy another if I can resolve this issue.

    Plugin Author Rustaurius

    (@rustaurius)

    Hi Ahia,

    Instead of replacing “administrator”, try copying the line first and then putting in “editor” on the copied line. Basically, that should allow both roles to access the plugin menu (I think). Let us know if that doesn’t work!

    Thread Starter ahiaruhe

    (@ahiaruhe)

    Nope, doesn’t quite work – only one or the other can see it. I tried swapping the roles in the two lines and whichever role is in the second line gets to see the menu.

    Here is what I did to make the editor and admin role to both have access to the plugin.

    /* Admin Page setup */
    function UPCP_Plugin_Menu() {
    	add_menu_page('Ultimate Product Catalogue Plugin', 'Atlus Catalogs', 'edit_others_posts', 'UPCP-options', 'UPCP_Output_Options',null , '50.5');
    }
    add_action( 'admin_menu','UPCP_Plugin_Menu');
    
    // Modify capability
    function my_page_capability( $capability ) {
    	return 'edit_others_posts';
    }
    add_filter( 'option_page_capability_my_page_slug','my_page_capability' );

    I used the add_action to hook into the admin area sidebar. Then created a function that added a filter to the hook. Finally adding the filter to the hook.

    I needed the same thing where a different role would have access to the plugin.

    Thread Starter ahiaruhe

    (@ahiaruhe)

    Thanks a lot jamkddr, I’l give it a try.

    I also tried it without the action hook and filter and that seems to work as well. Just change ‘administrator’ with ‘edit_others_posts’ which is a lot simpler but the code that I had I found on www.remarpro.com while looking up how to allow different users to use plug-ins.

    If this has resolved your issue, I think that the authors would like this closed with a resolved.

    Thanks for the help jamkddr and hope your issue was resolved ahiarue!

    Thread Starter ahiaruhe

    (@ahiaruhe)

    Thanks a lot jamkddr, just simply replacing ‘administrator’ with ‘edit_others_posts’ worked a treat. Good work!

    Be nice to have a “minimum role” selection built into the plugin settings, but appreciate it wouldn’t be priority. Or maybe having ‘edit_others_posts’ in that file would cover it anyway?

    Thanks again jamkddr

    Thanks for the feature suggestion, we’ll make a note of it.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘User Roles for Access to UPC Products’ is closed to new replies.