Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
wermarter committed Dec 19, 2023
1 parent fa274ea commit bb0dbad
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/levansy-access-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@nestjs/passport": "^10.0.1",
"@nestjs/platform-express": "^10.2.8",
"@nestjs/swagger": "^7.1.16",
"@ucast/mongo": "^2.4.3",
"argon2": "^0.31.2",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
Expand Down
31 changes: 31 additions & 0 deletions apps/levansy-access-service/src/domain/entity/permission.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { MongoQuery } from '@ucast/mongo'

import { BaseEntity } from './base-entity'

export type Permission = BaseEntity & {
index: number
name: string
description: string
rule: {
inverted: boolean
actions: string[]
subjects: string[]
conditions: MongoQuery
}
}

export enum Action {
Manage = 'manage',
Create = 'create',
Read = 'read',
Update = 'update',
Delete = 'delete',
}

export enum Subject {
WebApp = 'web-app',
BioProduct = 'bio-product',
Permission = 'permission',
Role = 'role',
User = 'user',
}
10 changes: 10 additions & 0 deletions apps/levansy-access-service/src/domain/entity/role.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { BaseEntity } from './base-entity'
import { Permission } from './permission'

export type Role = BaseEntity & {
index: string
name: string
description: string

permissions: string[] | Permission[]
}
Empty file.
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bb0dbad

Please sign in to comment.