Subject: Editors cannot save event locations: permission check in event_tax_save_changes() requires manage_eventon even though the role has the taxonomy capabilities
Environment
EventON 5.1.2
WordPress 7.1.5, Multisite, PHP 8.3
User role: Editor (default WordPress role)
Description
A user with the Editor role can open an event, sees the list of existing event locations, and can select one. Clicking "Save" in the location dialog fails with the message "You do not have permission to perform this action." Giving the Editor role the capabilities defined for the event_location taxonomy (manage_eventon_terms, edit_eventon_terms, assign_eventon_terms) and edit_eventon does not help.
Steps to reproduce
Log in as an Editor.
Edit an event and open the location selection.
Select or create a location and click "Save".
Expected result
The location is saved, since the Editor can create and edit events and has the taxonomy capabilities for event_location.
Actual result
The AJAX request eventon_event_tax_save_changes returns the error above.
Findings
A backtrace on wp_die shows that the error is sent from includes/admin/class-admin-taxonomies_editor.php, line 172 (wp_send_json_error).
That line belongs to the check in event_tax_save_changes():
php
if ( ! current_user_can('edit_eventon') && ! current_user_can('manage_eventon') ) {
wp_send_json_error( array( 'msg' => __('You do not have permission to perform this action.', 'eventon') ) );
}
With the Editor role holding edit_eventon, edit_eventons, manage_eventon_terms, edit_eventon_terms and assign_eventon_terms, current_user_can('edit_eventon') still returns false at runtime. My assumption (not verified) is that edit_eventon is a post meta capability of the ajde_events post type. Calling current_user_can() with it and without a post ID always fails. WordPress logs a related notice: "map_meta_cap was called incorrectly. Checking the edit_post capability must always refer to a specific post."
The check passes only after granting manage_eventon. That capability also opens the EventON settings pages for the Editor, which is far more than needed for saving a location.
Suggested fix
Check the capabilities that the taxonomy defines (assign_eventon_terms for selecting, edit_eventon_terms/manage_eventon_terms for creating or editing locations) or a post-specific check such as current_user_can( 'edit_post', $event_id ), instead of requiring manage_eventon. The same check appears in class-admin-cpt.php (lines 152 and 201) and class-highlights.php and may need the same review.
Workaround used
Granting manage_eventon to the Editor role. Alternatively, a user_has_cap filter that grants it only for the action eventon_event_tax_save_changes.
Separate issue (same installation)
The log also shows WordPress database error Table 'wp_evo_highlights' doesn't exist when loading the event edit screen (EVO_HIGH->content).