PluginProbe
Elementor Website Builder – more than just a page builder / 4.1.0-dev3
Elementor Website Builder – more than just a page builder v4.1.0-dev3
4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 All 453 releases
← All changes | includes/template-library/manager.php +0 -9 4.2.44.1.0-dev3 View file →
@@ -26,9 +26,8 @@
26 26 class Manager {
27 27
28 28 const ERROR_TEMPLATE_SOURCE_NOT_FOUND = 'Template source not found.';
29 29 const ERROR_TEMPLATE_IDS_MISSING = 'Template IDs are missing.';
30 - const ERROR_JSON_UPLOAD_NOT_ALLOWED = 'Uploading JSON files is not allowed for this user.';
31 30
32 31 /**
33 32 * Registered template sources.
34 33 *
@@ -600,12 +599,8 @@
600 599 *
601 600 * @return mixed Whether the export succeeded or failed.
602 601 */
603 602 public function import_template( array $data ) {
604 - if ( ! User::is_current_user_can_upload_json() ) {
605 - return new \WP_Error( 'template_error', self::ERROR_JSON_UPLOAD_NOT_ALLOWED );
606 - }
607 -
608 603 // If the template is a JSON file, allow uploading it.
609 604 add_filter( 'elementor/files/allow-file-type/json', [ $this, 'enable_json_template_upload' ] );
610 605 add_filter( 'elementor/files/allow_unfiltered_upload', [ $this, 'enable_json_template_upload' ] );
611 606
@@ -901,12 +896,8 @@
901 896 * @throws \Exception If current user has no permission or the post is not found.
902 897 */
903 898 private function handle_ajax_request( $ajax_request, array $data ) {
904 899 if ( ! User::is_current_user_can_edit_post_type( Source_Local::CPT ) ) {
905 - throw new \Exception( 'Access denied.' );
906 - }
907 -
908 - if ( 'import_template' === $ajax_request && ! User::is_current_user_can_upload_json() ) {
909 900 throw new \Exception( 'Access denied.' );
910 901 }
911 902
912 903 if ( ! empty( $data['editor_post_id'] ) ) {