Skip to content

Commit

Permalink
Merge pull request #139 from RRZE-Webteam/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
rvdforst authored Dec 13, 2024
2 parents 7af5166 + 79b6097 commit 2c4e58f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cms-workflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin Name: CMS-Workflow
Plugin URI: https://github.com/RRZE-Webteam/cms-workflow
Description: Redaktioneller Workflow.
Version: 2.0.0
Version: 2.0.1
Author: RRZE Webteam
Author URI: https://blogs.fau.de/webworking/
License: GNU General Public License v2
Expand Down
8 changes: 4 additions & 4 deletions includes/Modules/Versioning/Versioning.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public function filter_post_row_actions($actions, $post)
. '">' . __('Kopieren', 'cms-workflow') . '</a>';
}

if (current_user_can($cap->edit_posts) && $post->post_status == 'publish' && ($this->is_author(get_current_user_id(), $post->ID) || current_user_can('manage_options'))) {
if (current_user_can($cap->edit_posts) && $post->post_status == 'publish' && ($this->is_author(get_current_user_id(), $post->ID) || current_user_can('edit_published_posts'))) {
$actions['edit_as_version'] = '<a href="' . admin_url('admin.php?action=version_as_new_post_draft&post=' . $post->ID) . '" title="'
. esc_attr(__('Dieses Element als neue Version duplizieren', 'cms-workflow'))
. '">' . __('Neue Version', 'cms-workflow') . '</a>';
Expand Down Expand Up @@ -287,7 +287,7 @@ public function version_as_new_post_draft()

$cap = $this->get_available_post_types($post->post_type)->cap;

if (!current_user_can($cap->edit_posts) || $post->post_status != 'publish' || (!$this->is_author(get_current_user_id(), $post->ID) && !current_user_can('manage_options'))) {
if (!current_user_can($cap->edit_posts) || $post->post_status != 'publish' || (!$this->is_author(get_current_user_id(), $post->ID) && !current_user_can('edit_published_posts'))) {
wp_die(__('Sie haben nicht die erforderlichen Rechte, um eine neue Version zu erstellen.', 'cms-workflow'));
}

Expand Down Expand Up @@ -457,7 +457,7 @@ public function admin_notices()
$permalink = get_permalink($old_post_id);
$post_title = get_the_title($old_post_id);

if (current_user_can('manage_categories')) {
if (current_user_can('edit_published_posts')) {
$this->show_admin_notice(sprintf(__('Lokale Version vom Dokument &bdquo;<a href="%1$s" target="__blank">%2$s</a>&ldquo;. Überschreiben Sie das ursprüngliche Dokument, indem Sie auf &bdquo;Veröffentlichen&rdquo; klicken.', 'cms-workflow'), $permalink, $post_title));
} else {
$this->show_admin_notice(sprintf(__('Lokale Version vom Dokument &bdquo;<a href="%1$s" target="__blank">%2$s</a>&ldquo;.', 'cms-workflow'), $permalink, $post_title));
Expand Down Expand Up @@ -1362,7 +1362,7 @@ public function admin_bar_submenu()
}

$cap = $this->get_available_post_types($post->post_type)->cap;
if (current_user_can($cap->edit_posts) && $post->post_status == 'publish' && ($this->is_author(get_current_user_id(), $post->ID) || current_user_can('manage_options'))) {
if (current_user_can($cap->edit_posts) && $post->post_status == 'publish' && ($this->is_author(get_current_user_id(), $post->ID) || current_user_can('edit_published_posts'))) {
} else {
return;
}
Expand Down

0 comments on commit 2c4e58f

Please sign in to comment.