Skip to content

Commit

Permalink
Update safe-redirect-manager.php
Browse files Browse the repository at this point in the history
Added changes to restrict capabilities
  • Loading branch information
inathani committed Aug 29, 2012
1 parent 4286e15 commit a40b9f6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions safe-redirect-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,17 @@ public function action_register_post_types() {
'parent_item_colon' => '',
'menu_name' => __( 'Safe Redirect Manager', 'safe-redirect-manager' )
);
$this_capability = 'edit_posts';
$this_capability = apply_filters( 'safe_redirect_restrict_to_capability', $this_capability );
$capabilities = array(
'edit_post' => $this_capability,
'read_post' => $this_capability,
'delete_post' => $this_capability,
'edit_posts' => $this_capability,
'edit_others_posts' => $this_capability,
'publish_posts' => $this_capability,
'read_private_posts' => $this_capability
);
$redirect_args = array(
'labels' => $redirect_labels,
'public' => false,
Expand All @@ -370,6 +381,7 @@ public function action_register_post_types() {
'query_var' => false,
'rewrite' => false,
'capability_type' => 'post',
'capabilities' => $capabilities,
'has_archive' => false,
'hierarchical' => false,
'register_meta_box_cb' => array( $this, 'action_redirect_rule_metabox' ),
Expand Down

0 comments on commit a40b9f6

Please sign in to comment.