diff --git a/includes/Rest/Help/Help.php b/includes/Rest/Help/Help.php index 8eb7b1a..ef027f4 100644 --- a/includes/Rest/Help/Help.php +++ b/includes/Rest/Help/Help.php @@ -19,7 +19,7 @@ public function register_routes() { [ [ 'methods' => WP_REST_Server::READABLE, - 'permission_callback' => [ $this, 'permission' ], + 'permission_callback' => [ $this, 'can_view_wemail' ], 'callback' => [ $this, 'index' ], ], ] @@ -31,7 +31,7 @@ public function register_routes() { [ [ 'methods' => WP_REST_Server::CREATABLE, - 'permission_callback' => [ $this, 'permission' ], + 'permission_callback' => [ $this, 'can_view_wemail' ], 'callback' => [ $this, 'send_ping' ], ], ] @@ -43,7 +43,7 @@ public function register_routes() { [ [ 'methods' => WP_REST_Server::CREATABLE, - 'permission_callback' => [ $this, 'permission' ], + 'permission_callback' => [ $this, 'can_view_wemail' ], 'callback' => [ $this, 'receive_ping' ], ], ] @@ -111,8 +111,4 @@ public function disconnect_wemail() { ] ); } - - public function permission( $request ) { - return wemail()->user->can( 'view_wemail' ); - } }