Custom user role cannot access Events in admin

Home Forums Calendar Products Events Calendar PRO Custom user role cannot access Events in admin

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #32654
    Mark
    Participant

    I am having a problem that seems very strange. I created a new custom user role for a project and cannot figure out why the Events menu will not show in the admin when logged in as a user with the custom role. I have triple checked the capabilities of my custom role and it seems it should be working but the Events menu will not display.

    I read this forum post:

    Role-Based Access to Event Editing Creation

    Joey said that you guys rely on the basic WP capabilities for permissions, I am using these (Editor capabilities):
    ‘delete_others_pages’ => true,
    ‘delete_others_posts’ => true,
    ‘delete_pages’ => true,
    ‘delete_posts’ => true,
    ‘delete_private_pages’ => true,
    ‘delete_private_posts’ => true,
    ‘delete_published_pages’ => true,
    ‘delete_published_posts’ => true,
    ‘edit_others_pages’ => true,
    ‘edit_others_posts’ => true,
    ‘edit_pages’ => true,
    ‘edit_posts’ => true,
    ‘edit_private_pages’ => true,
    ‘edit_private_posts’ => true,
    ‘edit_published_pages’ => true,
    ‘edit_published_posts’ => true,
    ‘manage_categories’ => true,
    ‘manage_links’ => true,
    ‘moderate_comments’ => true,
    ‘publish_pages’ => true,
    ‘publish_posts’ => true,
    ‘read’ => true,
    ‘read_private_pages’ => true,
    ‘read_private_posts’ => true,
    ‘unfiltered_html’ => true,
    ‘upload_files’ => true,

    Any idea why the Events menu would not display?

    Thanks!

    #32656
    Jonah
    Participant

    Hi Mark, can you please post the code you are using to create the new Role so I can test it out locally? Please post to http://snippi.com/ or https://gist.github.com/

    Thanks,
    Jonah

    #32658
    Mark
    Participant

    Thanks for the quick response Jonah.

    Here ya go: http://snippi.com/s/vlgnuk8

    #32685
    Jonah
    Participant

    Hi Mark,

    We actually add a bunch of our capabilties now. You can see what’s added for admins, editors, etc by looking at /wp-content/plugins/the-events-calendar/lib/the-events-calendar.class.php around line 737. You should be able to take this and model it with your add_role function to setup your custom role.

    Does that help?

    – Jonah

    #32696
    Mark
    Participant

    Ahaa!! Success! Thank you very much! I strongly suggest you add these specifics to the documentation as this was a crucial bit of code to get my project moving and would’ve been a deal-breaker had I not been able to get this working. Once again we truly appreciate the prompt and friendly support. Cheers!

    #32698
    Jonah
    Participant

    Sweet, glad that worked! Good call, I’ve gone ahead an added an FAQ for the mean time: https://theeventscalendar.com/faq/what-plugin-capabilities-are-there-for-creating-custom-roles/ – we’re planning on doing some documentation updates in the near future so it will make more sense to include this somewhere else then.

    Let me know if you need anything else!

    – Jonah

    #43785
    Mark
    Participant

    This reply is private.

    #43833
    Jonah
    Participant

    Hi Mark,

    First try deactivating all other plugins to make sure another plugin is not interfering with things. Let me know if you’ve done that.

    Thanks,
    Jonah

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Custom user role cannot access Events in admin’ is closed to new replies.