mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
bf45e97641
* Update types * fix circular dep * type imports * lint type imports and --fix
36 lines
839 B
TypeScript
36 lines
839 B
TypeScript
import type { GroupPermission } from "@shared/types";
|
|
import Group from "./Group";
|
|
import User from "./User";
|
|
import Model from "./base/Model";
|
|
import Relation from "./decorators/Relation";
|
|
import Field from "./decorators/Field";
|
|
import { observable } from "mobx";
|
|
|
|
/**
|
|
* Represents a user's membership to a group.
|
|
*/
|
|
class GroupUser extends Model {
|
|
static modelName = "GroupUser";
|
|
|
|
/** The ID of the user. */
|
|
userId: string;
|
|
|
|
/** The user that belongs to the group. */
|
|
@Relation(() => User, { onDelete: "cascade" })
|
|
user: User;
|
|
|
|
/** The ID of the group. */
|
|
groupId: string;
|
|
|
|
/** The group that the user belongs to. */
|
|
@Relation(() => Group, { onDelete: "cascade" })
|
|
group: Group;
|
|
|
|
/** The permission of the user in the group. */
|
|
@Field
|
|
@observable
|
|
permission: GroupPermission;
|
|
}
|
|
|
|
export default GroupUser;
|