blob: 35eb33de1971724bb9c5a85b5397fed0c3ac5fd0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
import {Table, Model, Column, HasMany} from 'sequelize-typescript';
import { default as User } from './User';
type UserPrivilege = {
privilege: string,
description: string,
internal: boolean
}
@Table
export default class UserGroup extends Model<UserGroup> {
@Column
name: string;
@HasMany(() => User)
users: User[];
@Column
canCreateUsers: boolean;
@Column
canDeleteUsers: boolean;
@Column
canEditUsers: boolean;
@Column
canCreateProjects: boolean;
@Column
canDeleteProjects: boolean;
@Column
canEditProjects: boolean;
@Column
isInternal: boolean
@Column
description: string;
getPrivelege() : UserPrivilege {
return {
privilege : this.name,
description : this.description,
internal : this.isInternal
}
}
}
|