Skip to content

Prima Authorization with Permit.io and Prisma Client Extension

Notifications You must be signed in to change notification settings

Tabintel/prisma-permit-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prisma Permit Authorization

Asset management system with role-based access control using Prisma and Permit.io.

Permit Dashboard

Features

  • Role-based access control with Permit.io
  • Asset category management
  • User registration and authorization
  • Prisma Client Extension for permission checks
  • PostgreSQL with Neon serverless database integration

Setup

  1. Clone the repository and navigate into it:
git clone https://github.com/Tabintel/prisma-permit-auth.git
cd prisma-permit-auth
  1. Install dependencies:
npm install
  1. Create an .env file in the root directory, setup the database connection, and enter the details below. Get your Permit.io SDK key
DATABASE_URL="your-postgresql-url"
PERMIT_SDK_KEY="your-permit-key"
PORT=3000
  1. Run migrations:
npx prisma migrate dev
  1. Start the server:
npm run dev

API Endpoints

Development server: http://localhost:3000

  • POST /api/users - Register new user
  • POST /api/assets - Create asset
  • GET /api/assets - List assets
  • PUT /api/assets/:id - Update asset
  • DELETE /api/assets/:id - Delete asset

Authorization

Configure roles and permissions in Permit.io dashboard:

  • Manager: Full access
  • Accountant: Financial reports access
  • Developer: Software licenses access

About

Prima Authorization with Permit.io and Prisma Client Extension

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published