diff --git a/modules/calendar/calendar.php b/modules/calendar/calendar.php index d182ab08..d9120655 100644 --- a/modules/calendar/calendar.php +++ b/modules/calendar/calendar.php @@ -440,6 +440,16 @@ public function action_admin_submenu() */ public function install() { + + $viewCapability = $this->getViewCapability(); + $eligible_roles = ['administrator', 'editor', 'author']; + + foreach ($eligible_roles as $eligible_role) { + $role = get_role($eligible_role); + if (is_object($role) && !$role->has_cap($viewCapability)) { + $role->add_cap($viewCapability); + } + } } /** diff --git a/modules/content-board/content-board.php b/modules/content-board/content-board.php index 2d325a23..d00038ba 100644 --- a/modules/content-board/content-board.php +++ b/modules/content-board/content-board.php @@ -358,6 +358,15 @@ public function print_configure_view() */ public function install() { + $viewCapability = $this->getViewCapability(); + $eligible_roles = ['administrator', 'editor', 'author']; + + foreach ($eligible_roles as $eligible_role) { + $role = get_role($eligible_role); + if (is_object($role) && !$role->has_cap($viewCapability)) { + $role->add_cap($viewCapability); + } + } } /** diff --git a/modules/content-overview/content-overview.php b/modules/content-overview/content-overview.php index 1ee13eb3..d61ea848 100644 --- a/modules/content-overview/content-overview.php +++ b/modules/content-overview/content-overview.php @@ -361,6 +361,15 @@ public function print_configure_view() */ public function install() { + $viewCapability = $this->getViewCapability(); + $eligible_roles = ['administrator', 'editor', 'author']; + + foreach ($eligible_roles as $eligible_role) { + $role = get_role($eligible_role); + if (is_object($role) && !$role->has_cap($viewCapability)) { + $role->add_cap($viewCapability); + } + } } /**