Skip to content

Commit

Permalink
Merge pull request #1665 from publishpress/feature/#1640_Grant_Calend…
Browse files Browse the repository at this point in the history
…ar_Overview_and_Boards_screens_access_to_editors_and_authors

feature/#1640_Grant_Calendar_Overview_and_Boards_screens_access_to_editors_and_authors
  • Loading branch information
olatechpro authored May 27, 2024
2 parents 9441fa0 + 2d4073f commit c82e9ab
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/calendar/calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

/**
Expand Down
9 changes: 9 additions & 0 deletions modules/content-board/content-board.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

/**
Expand Down
9 changes: 9 additions & 0 deletions modules/content-overview/content-overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

/**
Expand Down

0 comments on commit c82e9ab

Please sign in to comment.