Auth for everything (and everything auth) #6 #35

Merged
philipp merged 39 commits from feature/6-api_auth into dev 2020-12-18 21:53:18 +00:00
5 changed files with 13 additions and 3 deletions
Showing only changes of commit 2240a45a91 - Show all commits

View File

@ -1,4 +1,5 @@
import {
IsEnum,
IsInt,
IsNotEmpty
} from "class-validator";
@ -25,12 +26,14 @@ export class CreatePermission {
* The permissions's target.
*/
@IsNotEmpty()
@IsEnum(PermissionTarget)
target: PermissionTarget;
/**
* The permissions's action.
*/
@IsNotEmpty()
@IsEnum(PermissionAction)
action: PermissionAction;
/**

View File

@ -1,4 +1,5 @@
import {
IsEnum,
IsInt,
IsNotEmpty
} from "class-validator";
@ -29,12 +30,14 @@ export class Permission {
*/
@Column({ type: 'varchar' })
@IsNotEmpty()
@IsEnum(PermissionTarget)
target: PermissionTarget;
/**
* The action type
*/
@Column({ type: 'varchar' })
@IsEnum(PermissionAction)
action: PermissionAction;
/**

View File

@ -1,6 +1,6 @@
export enum PermissionAction {
READ = 'READ',
ADD = 'ADD',
GET = 'GET',
CREATE = 'CREATE',
UPDATE = 'UPDATE',
DELETE = 'DELETE'
}

View File

@ -4,5 +4,6 @@ export enum PermissionTarget {
TEAM = 'RUNNERTEAM',
TRACK = 'TRACK',
USER = 'USER',
GROUP = 'USERGROUP'
GROUP = 'USERGROUP',
PERMISSION = 'PERMISSION'
}

View File

@ -1,4 +1,5 @@
import {
IsEnum,
IsInt,
IsNotEmpty,
IsObject
@ -29,12 +30,14 @@ export class ResponsePermission {
* The permissions's target.
*/
@IsNotEmpty()
@IsEnum(PermissionTarget)
target: PermissionTarget;
/**
* The permissions's action.
*/
@IsNotEmpty()
@IsEnum(PermissionAction)
action: PermissionAction;
public constructor(permission: Permission) {