Menu
Libraries |
Category

sapper-rbac

  • Purpose: Role-based access control (RBAC) library designed for Sapper applications, working on both server-side and client-side.
  • Key Features:
    • Defines route permissions with a flexible router configuration.
    • Supports unrestricted routes (e.g., /login.*) and restricted routes with required roles (e.g., ['admin', 'sales']).
    • Integrates with Sapper's session management and routing.
  • Target Audience: Developers building Sapper applications requiring role-based access control.
  • Framework Support: Primarily for Sapper (Svelte's framework), with seamless integration into both server and client-side logic.
  • Usage Highlights:
    • Define route permissions using a Router instance.
    • Server-side integration via middleware with customizable deny and grant handlers.
    • Client-side integration via Sapper's page and session stores.
    • Supports dynamic redirection (e.g., to /login on denied access).
  • Session Requirements: Requires a user object with a scope array listing the user's roles (e.g., ['admin', 'other']).

sveltesveltejssapperrbacrolesecurityapissr

Comments