Code Duplication    Length = 7-7 lines in 2 locations

_inc/lib/class.core-rest-api-endpoints.php 2 locations

@@ 724-730 (lines=7) @@
721
	 *
722
	 * @return bool|WP_Error True if user is able to change master user.
723
	 */
724
	public static function set_connection_owner_permission_callback() {
725
		if ( get_current_user_id() === Jetpack_Options::get_option( 'master_user' ) ) {
726
			return true;
727
		}
728
729
		return new WP_Error( 'invalid_user_permission_set_connection_owner', self::$user_permissions_error_msg, array( 'status' => self::rest_authorization_required_code() ) );
730
	}
731
732
	/**
733
	 * Verify that a user can use the /connection/user endpoint. Has to be a registered user and be currently linked.
@@ 741-747 (lines=7) @@
738
	 *
739
	 * @return bool|WP_Error True if user is able to unlink.
740
	 */
741
	public static function unlink_user_permission_callback() {
742
		if ( current_user_can( 'jetpack_connect_user' ) && Jetpack::is_user_connected( get_current_user_id() ) ) {
743
			return true;
744
		}
745
746
		return new WP_Error( 'invalid_user_permission_unlink_user', self::$user_permissions_error_msg, array( 'status' => self::rest_authorization_required_code() ) );
747
	}
748
749
	/**
750
	 * Verify that user can manage Jetpack modules.