feat(ip): protect persona 'formula' — secret fields only super_admin sees/edits

IP protection so casual copying yields inferior results:
- SECRET_PERSONA_FIELDS (pains/objections/negotiation_levers/opener/tolerance +
  pain rootCause/resolutionConditions): only super_admin can view/edit them.
- list_personas/get_persona/update_persona/get_group strip these for role=admin (and
  hide sales_kit + pain-fit report from admins too).
- update_persona rejects admin attempts to set secret fields (403).
- PersonaForm hides the 'การขาย' recipe section for non-super-admin (shows locked note);
  auth.isSuperAdmin getter added.
Rebuilt dist. Added test_ip_protection.
This commit is contained in:
Macky
2026-08-09 07:22:50 +07:00
parent a04bc2add8
commit e1d61e1e1e
29 changed files with 156 additions and 39 deletions

View File

@@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sales Trainer</title>
<script type="module" crossorigin src="/assets/index-DOaJiTJw.js"></script>
<script type="module" crossorigin src="/assets/index-BCax2GDh.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-B9WjPRES.css">
</head>
<body>