mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) move home server into core
Summary: This moves enough server material into core to run a home server. The data engine is not yet incorporated (though in manual testing it works when ported). Test Plan: existing tests pass Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2552
This commit is contained in:
58
app/gen-server/entity/AclRule.ts
Normal file
58
app/gen-server/entity/AclRule.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import {BaseEntity, ChildEntity, Column, Entity, JoinColumn, ManyToOne, OneToOne,
|
||||
PrimaryGeneratedColumn, RelationId, TableInheritance} from "typeorm";
|
||||
|
||||
import {Document} from "./Document";
|
||||
import {Group} from "./Group";
|
||||
import {Organization} from "./Organization";
|
||||
import {Workspace} from "./Workspace";
|
||||
|
||||
@Entity('acl_rules')
|
||||
@TableInheritance({ column: { type: "int", name: "type" } })
|
||||
export class AclRule extends BaseEntity {
|
||||
|
||||
@PrimaryGeneratedColumn()
|
||||
public id: number;
|
||||
|
||||
@Column()
|
||||
public permissions: number;
|
||||
|
||||
@OneToOne(type => Group, group => group.aclRule)
|
||||
@JoinColumn({name: "group_id"})
|
||||
public group: Group;
|
||||
}
|
||||
|
||||
|
||||
@ChildEntity()
|
||||
export class AclRuleWs extends AclRule {
|
||||
|
||||
@ManyToOne(type => Workspace, workspace => workspace.aclRules)
|
||||
@JoinColumn({name: "workspace_id"})
|
||||
public workspace: Workspace;
|
||||
|
||||
@RelationId((aclRule: AclRuleWs) => aclRule.workspace)
|
||||
public workspaceId: number;
|
||||
}
|
||||
|
||||
|
||||
@ChildEntity()
|
||||
export class AclRuleOrg extends AclRule {
|
||||
|
||||
@ManyToOne(type => Organization, organization => organization.aclRules)
|
||||
@JoinColumn({name: "org_id"})
|
||||
public organization: Organization;
|
||||
|
||||
@RelationId((aclRule: AclRuleOrg) => aclRule.organization)
|
||||
public orgId: number;
|
||||
}
|
||||
|
||||
|
||||
@ChildEntity()
|
||||
export class AclRuleDoc extends AclRule {
|
||||
|
||||
@ManyToOne(type => Document, document => document.aclRules)
|
||||
@JoinColumn({name: "doc_id"})
|
||||
public document: Document;
|
||||
|
||||
@RelationId((aclRule: AclRuleDoc) => aclRule.document)
|
||||
public docId: number;
|
||||
}
|
||||
Reference in New Issue
Block a user