diff --git a/includes/Api/Permissions.php b/includes/Api/Permissions.php index 66e8a10..d194d32 100644 --- a/includes/Api/Permissions.php +++ b/includes/Api/Permissions.php @@ -35,6 +35,14 @@ class Permissions { * Used for analytics and admin-only endpoints */ public static function check_admin_permission(): bool { - return current_user_can('manage_woocommerce') || current_user_can('manage_options'); + $has_wc = current_user_can('manage_woocommerce'); + $has_opts = current_user_can('manage_options'); + $result = $has_wc || $has_opts; + error_log(sprintf('WooNooW Permissions: check_admin_permission() - WC:%s Options:%s Result:%s', + $has_wc ? 'YES' : 'NO', + $has_opts ? 'YES' : 'NO', + $result ? 'ALLOWED' : 'DENIED' + )); + return $result; } } \ No newline at end of file