Skip to content

Commit

Permalink
Require the wrangle_* permission to manually create events
Browse files Browse the repository at this point in the history
Normally they're created dynamically through application forms, but occasionally Program Managers need to manually create one.
  • Loading branch information
timiwahalahti authored and iandunn committed Sep 29, 2023
1 parent fce7206 commit 9292e30
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions public_html/wp-content/plugins/wcpt/wcpt-meetup/meetup-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,19 @@ public function register_post_types() {
'show_ui' => true,
'can_export' => true,
'capability_type' => Meetup_Application::POST_TYPE,
'capabilities' => array(
// `read` and `edit_posts` are intentionally allowed, so organizers can edit their own posts (but not others').
'create_posts' => 'wordcamp_wrangle_meetups',
'delete_posts' => 'wordcamp_wrangle_meetups',
'delete_others_posts' => 'wordcamp_wrangle_meetups',
'delete_private_posts' => 'wordcamp_wrangle_meetups',
'delete_published_posts' => 'wordcamp_wrangle_meetups',
'edit_others_posts' => 'wordcamp_wrangle_meetups',
'edit_private_posts' => 'wordcamp_wrangle_meetups',
'edit_published_posts' => 'wordcamp_wrangle_meetups',
'publish_posts' => 'wordcamp_wrangle_meetups',
'read_private_posts' => 'wordcamp_wrangle_meetups',
),
'map_meta_cap' => true,
'hierarchical' => false,
'has_archive' => false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,19 @@ function register_post_types() {
'show_ui' => true,
'can_export' => true,
'capability_type' => WCPT_POST_TYPE_ID,
'capabilities' => array(
// `read` and `edit_posts` are intentionally allowed, so organizers can edit their own posts (but not others').
'create_posts' => 'wordcamp_wrangle_wordcamps',
'delete_posts' => 'wordcamp_wrangle_wordcamps',
'delete_others_posts' => 'wordcamp_wrangle_wordcamps',
'delete_private_posts' => 'wordcamp_wrangle_wordcamps',
'delete_published_posts' => 'wordcamp_wrangle_wordcamps',
'edit_others_posts' => 'wordcamp_wrangle_wordcamps',
'edit_private_posts' => 'wordcamp_wrangle_wordcamps',
'edit_published_posts' => 'wordcamp_wrangle_wordcamps',
'publish_posts' => 'wordcamp_wrangle_wordcamps',
'read_private_posts' => 'wordcamp_wrangle_wordcamps',
),
'map_meta_cap' => true,
'hierarchical' => false,
'has_archive' => true,
Expand Down

0 comments on commit 9292e30

Please sign in to comment.