link,[object Object]
Skip to content

Blur Policy Playbook (Operations) ​

Purpose: End-to-end procedures for configuring, validating, QA and troubleshooting the listing fields blur policy. Audience: Admin, Developer, QA Prerequisites: Supabase cloud access; admin role in the app.

Components ​

  • Config table: public.blurred_fields
  • Function: public.can_view_field(p_listing, p_field_key, p_user?)
  • View: public.listing_view_secure
  • Admin UI: src/components/admin/subscription-plans/BlurredFieldsManager.tsx
  • Frontend hooks: useBlurredFields, useSelectiveDataLoading
  • Mapping: FIELD_TO_COLUMN_MAP, VISUALLY_BLURRED_FIELDS_TO_FETCH, COMPLETELY_BLOCKED_FIELDS_IF_BLURRED
  • Docs: docs/architecture/blur-policy.md

Operational flow ​

  1. Update configuration
  • Open Admin → Subscription Plans → Blurred Fields Manager
  • Create/toggle fields (unauth/free/starter/pro)
  • Alternative (DB): use admin_toggle_blurred_field(id, plan, enabled)
  1. Verify visibility
  • Public/Free: open /listing/:id unauthenticated / with a free user
  • Starter/Pro: sign in a user with an active subscription and verify sensitive fields
  • Admin/Owner: verify bypass (everything visible)
  1. Technical validation
  • View:
sql
select * from public.listing_view_secure where id='LISTING_UUID';
  • Function:
sql
select public.can_view_field('LISTING_UUID','monthly_profit');
  • Config:
sql
select field_key, is_blurred_for_unauthenticated, is_blurred_for_free, is_blurred_for_starter, is_blurred_for_pro
from public.blurred_fields order by field_key;

QA Checklist ​

  • Unauth:
    • Action buttons (action_*) blurred as configured
    • Sensitive media/URLs (screenshots/website_url) blurred
  • Free:
    • Financial/traffic metrics blurred when the flag is enabled
    • Structured description follows the matrix
  • Starter/Pro (active):
    • Fields blurred for free become visible at the corresponding level
    • Sensitive screenshots remain blurred if explicitly configured
  • Admin/Owner:
    • Full bypass (no blur)
  • Explore/Search:
    • explore_* behaves per configuration

Troubleshooting ​

  • "Field visible when it should be blurred"

    • Check blurred_fields row for that field_key
    • Confirm user subscription (status active, current_period_end not expired)
    • UI: ensure FIELD_TO_COLUMN_MAP contains the column and useSelectiveDataLoading doesn't select it when blurred
    • Server: query listing_view_secure and verify the column is NULL
  • "Field blurred for Admin/Owner"

    • Verify user is admin/owner (bypass implemented in function)
    • Re-auth and invalidate UI cache
  • "Admin toggle has no effect"

    • admin_toggle_blurred_field requires admin; check is_admin_user()
    • Reload (invalidate ['blurred-fields']), verify updated_at

Security ​

  • admin_toggle_blurred_field is SECURITY DEFINER with SET search_path TO 'public' and checks is_admin_user()
  • RLS on blurred_fields: public SELECT, admin-only mutations
  • Do not rely on UI only: listing_view_secure enforces server-side masking

Export / Audit ​

sql
-- Export CSV al matricei
copy (
  select field_key,
         is_blurred_for_unauthenticated, is_blurred_for_free,
         is_blurred_for_starter, is_blurred_for_pro,
         to_char(coalesce(updated_at, created_at),'YYYY-MM-DD') as updated
  from public.blurred_fields
  order by field_key
) to stdout with csv header;

Rolling back ​

  • For configuration mistakes: toggle back in UI or use admin_toggle_blurred_field with p_enabled=false
  • For systemic issues: ensure function/view exist from migrations (can_view_field, listing_view_secure)

Notes ​

  • "Visually blurred" fields can still be fetched and masked in UI; for sensitive data (image URLs, screenshots) block at source (do not select when blurred)