Changeset 3348751
- Timestamp:
- 08/22/2025 05:25:22 PM (6 months ago)
- Location:
- xpro-theme-builder/trunk
- Files:
-
- 4 edited
-
admin/class-xpro-rest-api.php (modified) (1 diff)
-
changelog.txt (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
xpro-theme-builder.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
xpro-theme-builder/trunk/admin/class-xpro-rest-api.php
r2862456 r3348751 530 530 * @return boolean 531 531 */ 532 public static function check_permission() { 533 return current_user_can( 'edit_posts' ); 534 } 532 // public static function check_permission() { 533 // return current_user_can( 'edit_posts' ); 534 // } 535 536 /** 537 * Checks permission. 538 * 539 * @param WP_REST_Request $request The request. 540 * 541 * @return boolean|WP_Error 542 */ 543 public static function check_permission( $request ) { 544 $route = $request->get_route(); 545 546 if ( strpos( $route, 'create-post' ) !== false ) { 547 return current_user_can( 'publish_posts' ); 548 } 549 550 if ( strpos( $route, 'update-post' ) !== false || strpos( $route, 'delete-post' ) !== false ) { 551 $post_id = (int) $request['id']; 552 $post = get_post( $post_id ); 553 if ( ! $post ) { 554 return new WP_Error( 'rest_post_invalid', __( 'Invalid post.' ), array( 'status' => 404 ) ); 555 } 556 557 $allowed_types = array( 'post', 'page' ); 558 if ( ! in_array( $post->post_type, $allowed_types, true ) ) { 559 return new WP_Error( 'rest_forbidden', __( 'Post type not allowed.' ), array( 'status' => 403 ) ); 560 } 561 562 if ( $post->post_author != get_current_user_id() && ! current_user_can( 'edit_others_posts' ) ) { 563 return new WP_Error( 'rest_forbidden', __( 'Dilshad is testing not deleted or edit' ), array( 'status' => 403 ) ); 564 } 565 566 return true; 567 } 568 569 if ( strpos( $route, 'update-settings' ) !== false ) { 570 return current_user_can( 'manage_options' ); 571 } 572 573 return new WP_Error( 'rest_forbidden', __( 'Invalid permission.' ), array( 'status' => 403 ) ); 574 } 535 575 } 536 576 -
xpro-theme-builder/trunk/changelog.txt
r3324980 r3348751 1 = V 1.2.10 - 22 August 2025 = 2 3 - Fix: Resolved issue related to Access Control. 4 5 1 6 = V 1.2.9 - 09 July 2025 = 2 7 -
xpro-theme-builder/trunk/readme.txt
r3324980 r3348751 1 1 === Xpro Theme Builder For Elementor - FREE === 2 2 Plugin Name: Xpro Theme Builder For Elementor - FREE 3 Version: 1.2. 93 Version: 1.2.10 4 4 Contributors: Xpro 5 5 Tags: elementor, theme builder, header footer builder, sticky header, free theme builder 6 6 Requires at least: 5.0 7 Tested up to: 6.8. 17 Tested up to: 6.8.2 8 8 Stable tag: trunk 9 9 Requires PHP: 7.0 … … 290 290 == Changelog == 291 291 292 = V 1.2.10 - 22 August 2025 = 293 294 - Fix: Resolved issue related to Access Control. 295 296 292 297 = V 1.2.9 - 09 July 2025 = 293 298 -
xpro-theme-builder/trunk/xpro-theme-builder.php
r3324980 r3348751 6 6 * Author: Xpro 7 7 * Author URI: https://www.wpxpro.com/ 8 * Version: 1.2. 98 * Version: 1.2.10 9 9 * Developer: Xpro Team 10 10 * Text Domain: xpro-theme-builder 11 * Elementor tested up to: 3.3 0.111 * Elementor tested up to: 3.31.2 12 12 * 13 13 * @package xpro-theme-builder 14 14 */ 15 15 16 define( 'XPRO_THEME_BUILDER_VER', '1.2. 9' );16 define( 'XPRO_THEME_BUILDER_VER', '1.2.10' ); 17 17 define( 'XPRO_THEME_BUILDER_FILE', __FILE__ ); 18 18 define( 'XPRO_THEME_BUILDER_BASE', plugin_basename( __FILE__ ) );
Note: See TracChangeset
for help on using the changeset viewer.