Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TMS-962: Add Lunch Menus plugin caps to roles. #474

Merged
merged 3 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

- TMS-962: Add Lunch Menus plugin caps to roles.

## [1.48.0] - 2023-09-13

- TMS-973: Fix manual event sorting


## [1.47.0] - 2023-09-04

- TMS-964-2: Update translation and format pricing.
Expand Down
6 changes: 6 additions & 0 deletions lib/BlocksController.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,12 @@ private function allowed_block_types( $allowed_blocks, $context ) {
PostType\Contact::SLUG,
],
],
'acf/lunch-menu' => [
'post_types' => [
PostType\Page::SLUG,
PostType\Post::SLUG,
],
],
];

$blocks = apply_filters(
Expand Down
25 changes: 24 additions & 1 deletion lib/Roles.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,27 @@
'edit_manual_events',
];

/**
* Lunch Menu / lunch-menu-cpt.
*
* @var array
*/
private $lunch_menus_all_capabilities = [
'edit_lunch_menu',
'read_lunch_menu',
'delete_lunch_menu',
'edit_others_lunch_menus',
'delete_lunch_menus',
'publish_lunch_menus',
'read_private_lunch_menus',
'delete_private_lunch_menus',
'delete_published_lunch_menus',
'delete_others_lunch_menus',
'edit_private_lunch_menus',
'edit_published_lunch_menus',
'edit_lunch_menus',
];

/**
* Base taxonomy capabilities, only for admins.
*
Expand Down Expand Up @@ -207,7 +228,7 @@
'delete_material_types',
'assign_material_types',
];

Check failure on line 231 in lib/Roles.php

View workflow job for this annotation

GitHub Actions / phpcs-check

Whitespace found at end of line
/**
* Manual Event Category taxonomy
*
Expand Down Expand Up @@ -494,6 +515,7 @@
$role->add_caps( $this->contact_all_capabilities );
$role->add_caps( $this->dynamic_event_all_capabilities );
$role->add_caps( $this->manual_event_all_capabilities );
$role->add_caps( $this->lunch_menus_all_capabilities );

// Taxonomies
$role->add_caps( $this->taxonomy_category_all_capabilities );
Expand Down Expand Up @@ -548,6 +570,7 @@
$role->add_caps( $this->contact_all_capabilities );
$role->add_caps( $this->dynamic_event_all_capabilities );
$role->add_caps( $this->manual_event_all_capabilities );
$role->add_caps( $this->lunch_menus_all_capabilities );

// Taxonomies
$role->add_caps( [
Expand Down
Loading