Plugin Directory

Changeset 3403314


Ignore:
Timestamp:
11/26/2025 11:47:58 AM (4 months ago)
Author:
betterrecomaze
Message:

Check permissions

Location:
recomaze-ai-personalization
Files:
3 edited
15 copied

Legend:

Unmodified
Added
Removed
  • recomaze-ai-personalization/tags/1.0.58/README.md

    r3403304 r3403314  
    55Tested up to: 6.8
    66Requires PHP: 7.4
    7 Stable tag: 1.0.57
     7Stable tag: 1.0.58
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • recomaze-ai-personalization/tags/1.0.58/readme.txt

    r3403304 r3403314  
    55Tested up to: 6.8
    66Requires PHP: 7.4
    7 Stable tag: 1.0.57
     7Stable tag: 1.0.58
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • recomaze-ai-personalization/tags/1.0.58/recomaze-ai-personalization.php

    r3403304 r3403314  
    44 * Plugin URI:        https://recomaze.ai/woocommerce-integration/
    55 * Description:       Recomaze AI plugin maximizes revenue with real-time, AI-driven product recommendations. Easy integration, pay-per-result.
    6  * Version:           1.0.57
     6 * Version:           1.0.58
    77 * Requires at least: 5.8.1
    88 * Requires PHP:      7.4
     
    194194
    195195/**
     196 * Determine the capability required to manage Recomaze settings.
     197 *
     198 * Shop Managers get access via manage_woocommerce; otherwise fall back to manage_options.
     199 *
     200 * @return string
     201 */
     202function recomaze_get_admin_capability() {
     203    if ( current_user_can( 'manage_woocommerce' ) ) {
     204        return 'manage_woocommerce';
     205    }
     206
     207    return 'manage_options';
     208}
     209
     210/**
    196211 * Init Admin Menu.
    197212 *
     
    202217        __( 'Recomaze AI Personalization', 'recomaze-ai-personalization' ),
    203218        __( 'Recomaze AI Personalization', 'recomaze-ai-personalization' ),
    204         'manage_options',
     219        recomaze_get_admin_capability(),
    205220        'recomaze',
    206221        'recomaze_admin_page',
     
    413428 */
    414429function recomaze_api_permissions_check() {
    415     return current_user_can('manage_options');
     430    return current_user_can( 'manage_options' ) || current_user_can( 'manage_woocommerce' );
    416431}
    417432
  • recomaze-ai-personalization/trunk/README.md

    r3403304 r3403314  
    55Tested up to: 6.8
    66Requires PHP: 7.4
    7 Stable tag: 1.0.57
     7Stable tag: 1.0.58
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • recomaze-ai-personalization/trunk/readme.txt

    r3403304 r3403314  
    55Tested up to: 6.8
    66Requires PHP: 7.4
    7 Stable tag: 1.0.57
     7Stable tag: 1.0.58
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • recomaze-ai-personalization/trunk/recomaze-ai-personalization.php

    r3403304 r3403314  
    44 * Plugin URI:        https://recomaze.ai/woocommerce-integration/
    55 * Description:       Recomaze AI plugin maximizes revenue with real-time, AI-driven product recommendations. Easy integration, pay-per-result.
    6  * Version:           1.0.57
     6 * Version:           1.0.58
    77 * Requires at least: 5.8.1
    88 * Requires PHP:      7.4
     
    194194
    195195/**
     196 * Determine the capability required to manage Recomaze settings.
     197 *
     198 * Shop Managers get access via manage_woocommerce; otherwise fall back to manage_options.
     199 *
     200 * @return string
     201 */
     202function recomaze_get_admin_capability() {
     203    if ( current_user_can( 'manage_woocommerce' ) ) {
     204        return 'manage_woocommerce';
     205    }
     206
     207    return 'manage_options';
     208}
     209
     210/**
    196211 * Init Admin Menu.
    197212 *
     
    202217        __( 'Recomaze AI Personalization', 'recomaze-ai-personalization' ),
    203218        __( 'Recomaze AI Personalization', 'recomaze-ai-personalization' ),
    204         'manage_options',
     219        recomaze_get_admin_capability(),
    205220        'recomaze',
    206221        'recomaze_admin_page',
     
    413428 */
    414429function recomaze_api_permissions_check() {
    415     return current_user_can('manage_options');
     430    return current_user_can( 'manage_options' ) || current_user_can( 'manage_woocommerce' );
    416431}
    417432
Note: See TracChangeset for help on using the changeset viewer.