Browse Source

Feature/add permissions to access model (#2833)

* Add permissions to Access model

* Update changelog
pull/2918/head^2
Thomas Kaul 1 year ago
committed by GitHub
parent
commit
73c0843d51
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      CHANGELOG.md
  2. 5
      prisma/migrations/20240106131428_added_permissions_to_access/migration.sql
  3. 6
      prisma/schema.prisma

6
CHANGELOG.md

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Added
- Added `permissions` to the `Access` model
## 2.44.0 - 2024-01-24
### Fixed

5
prisma/migrations/20240106131428_added_permissions_to_access/migration.sql

@ -0,0 +1,5 @@
-- CreateEnum
CREATE TYPE "AccessPermission" AS ENUM ('READ', 'READ_RESTRICTED');
-- AlterTable
ALTER TABLE "Access" ADD COLUMN "permissions" "AccessPermission"[] DEFAULT ARRAY['READ_RESTRICTED']::"AccessPermission"[];

6
prisma/schema.prisma

@ -14,6 +14,7 @@ model Access {
createdAt DateTime @default(now())
granteeUserId String?
id String @id @default(uuid())
permissions AccessPermission[] @default([READ_RESTRICTED])
updatedAt DateTime @updatedAt
userId String
GranteeUser User? @relation("accessGet", fields: [granteeUserId], references: [id])
@ -196,6 +197,11 @@ model User {
Subscription Subscription[]
}
enum AccessPermission {
READ
READ_RESTRICTED
}
enum AssetClass {
CASH
COMMODITY

Loading…
Cancel
Save