rbac-pin-security

Enforce role-based access control and PIN authorization for sensitive POS operations.

Updated Nov 25, 2025
One-click install
npx skills add https://github.com/filimorniga-ux/farmacias-vallenar-suit --skill rbac-pin-security
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rbac-pin-security
Source: https://github.com/filimorniga-ux/farmacias-vallenar-suit/tree/main/.agent/skills/rbac-pin-security
Command: npx skills add https://github.com/filimorniga-ux/farmacias-vallenar-suit --skill rbac-pin-security

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Previene accesos y ejecuciones no autorizadas en operaciones sensibles al imponer control de roles y la solicitud de PIN jerárquico, y evita el uso de autenticación por email/contraseña en flujos críticos.

Core Features & Use Cases

  • Cero Email/Password: Obliga al flujo de autenticación por selector de sucursal, selección de usuario y teclado numérico (PIN 4 dígitos).
  • Umbrales de PIN: Solicita PIN de niveles superiores para acciones que superen umbrales (p. ej. ajustes de stock >100, descuentos >10%, eliminación de lotes).
  • Protección de Rutas y Middleware: Verifica jerarquía de roles contra la definición en src/domain/auth.ts y bloquea acceso si el rol es inferior.
  • Implementación Requerida: Integrar modales de PIN, HOCs o middleware de roles y evitar cualquier formulario de login con email/password.

Quick Start

Protect the inventory adjustment action by wrapping the handler with a ManagerPinModal that verifies the user's role and requests supervisor PIN for adjustments over 100 units.

Frequently Asked Questions about rbac-pin-security

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce role-based access control and require a PIN for sensitive POS operations?

To enforce role-based access control and PIN authorization, you wrap sensitive UI actions like inventory adjustments or discounts in a PIN modal. This verifies the user's hierarchical role and requests supervisor PIN confirmation when configurable thresholds are exceeded.

How does hierarchical role checking work for route protection in an admin panel?

Hierarchical role checking for route protection works by validating the user's role against definitions in your auth domain logic. The middleware blocks access if the user's role is lower than the required hierarchy level for the protected route.

Can I disable email and password authentication for my POS login flow?

Yes, you can disable email and password authentication by prohibiting those login forms. The system enforces a zero email/password policy, requiring authentication via branch selection, user selection, and a 4-digit numeric PIN pad.

What is the best way to require a supervisor PIN for high-threshold inventory adjustments?

The best way to require a supervisor PIN for high-threshold inventory adjustments is wrapping the handler with a ManagerPinModal. This verifies the user's role and prompts for supervisor PIN authorization for adjustments exceeding 100 units.

When do I need to request a PIN for critical operations like discounts or stock adjustments?

You need to request a PIN for critical operations when actions exceed configurable thresholds, such as stock adjustments over 100 units, discounts over 10%, or batch deletions. These actions trigger PIN modals tied to higher authority levels.

Why use a 4-digit PIN authentication flow instead of email and password for critical admin actions?

A 4-digit PIN authentication flow prevents unauthorized executions in critical operations by enforcing hierarchical access control. Disabling email and password authentication in favor of branch, user, and PIN selection eliminates common credential vulnerabilities in sensitive environments.