Support

Home Forums Event Espresso Premium EE4 roles and Capabilitys

EE4 roles and Capabilitys

Posted: April 20, 2015 at 10:08 am

Viewing 3 reply threads


Zoe E

April 20, 2015 at 10:08 am

Hi,

We are setting up a site that has multiple different roles,

We need them to be able to add events and add them to the correct category.

Currently have the following roles of the users.

function add_user_roles(){

		$roles =array(
	        'read'         => true,  // true allows this capability
	        'edit_posts'   => true,
	        'delete_posts' => false, // Use false to explicitly deny
	        'delete_pages' => false,
	        'moderate_comments' => false,
	        'edit_others_posts' => false,
	        'edit_pages' => true,
	        'edit_others_pages' => true,
	        'edit_published_pages' => true,
	        'publish_posts' => true,
	        'publish_pages' => true,
	        'administrator' => true,
	        'ee_read_ee' => true,
	        'ee_read_event' => true,
	        'ee_read_events' => true,
	        'espresso_general_settings_update_your_organization_settings' => false,
	        'espresso_general_settings_default' => false,
	        'ee_publish_events' => true,
	        'ee_edit_event' => true,
	        'ee_edit_events' => true,
	        'ee_edit_event_category' => true,
	        'ee_delete_event_category' =>true,
	        'ee_assign_event_category'=> true,
	        'ee_delete_event' => true, 
	        'ee_delete_events' => true,
	        'ee_edit_event_type' => true
		);

		//Need to add roles for showroom, accomodation, familysupport, healthfitness, training
		$result = add_role('showroom',__( 'Showroom' ), $roles);
		if ( null !== $result ) {
		    /* Role created! */
		}

		$result = add_role('accomodation',__( 'Accomodation' ), $roles);
		if ( null !== $result ) {
		    /* Role created! */
		}

		$result = add_role('familysupport',__( 'Family Support' ), $roles);
		if ( null !== $result ) {
		    /* Role created! */
		}

		$result = add_role('healthfitness',__( 'Health & Fitness' ), $roles);
		if ( null !== $result ) {
		    /* Role created! */
		}

		$result = add_role('training',__( 'Training' ), $roles);
		if ( null !== $result ) {
		    /* Role created! */
		}

	}
	add_action( 'init', 'add_user_roles');

Now they can log in and see the event admin page, issue is there is not add events button or can’t see any events,
I have been going through the spreadsheet but can’t see what one that could be causing issues so they can’t add events.

many Thanks


Josh

  • Support Staff

April 23, 2015 at 8:48 pm

Hi Zoe,

I ran your code on my site and it added the correct caps and roles so I could add new events. Since it’s not working for you, it may help to go to the Maintenance page as an admin and reset the EE capabilities.

A few more caps you might consider adding: ee_edit_published events, then also for adding venues or reading venues so venues can be selected from the editor: ee_read_venues. Also to add event datetimes and tickets: ee_read_default_price_types,
ee_read_default_prices,
ee_read_default_ticket,
ee_read_default_tickets.


Zoe E

May 7, 2015 at 9:38 am

Hi Josh,

This is still not working after i submitted what you have above.

I can’t see the other events :/ but i can now add one the issue is after adding one i get this error
“You do not have access to this route.”

http://prntscr.com/72l0ad

However the event does get added.

Many Thanks.


Josh

  • Support Staff

May 8, 2015 at 11:41 am

Hi Zoe,

Can you try temporarily adding all EE caps to the user role to see if that makes a difference? A quick way to add all EE caps is use the User Role Editor plugin. It has a filter where you edit the user role’s caps, and you input EE, then select all, then save.

If that does make a difference, then you can remove the caps from the user role to restrict access to specific parts of EE if need be.

Viewing 3 reply threads

The support post ‘EE4 roles and Capabilitys’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso