Created
May 12, 2016 21:41
-
-
Save aarmora/6a10d959a9b76c49ea7f5e3917218ded to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as mongoose from "mongoose"; | |
export interface LSClass { | |
create: Boolean; | |
delete: Boolean; | |
} | |
export interface LS { | |
class: LSClass; | |
} | |
export interface ACClass { | |
create: Boolean; | |
delete: Boolean; | |
} | |
export interface AC { | |
class: ACClass; | |
} | |
export interface LUWTile { | |
create: Boolean; | |
delete: Boolean; | |
} | |
export interface LUW { | |
tile: LUWTile; | |
} | |
export interface Organization { | |
luw: LUW; | |
ac: AC; | |
ls: LS; | |
} | |
export interface Permission { | |
com: Organization; | |
} | |
export interface IUser extends mongoose.Document { | |
name: String; | |
permissions: Permission; | |
} | |
export const UserSchema = new mongoose.Schema({ | |
name: { type: String, required: true }, | |
permissions: Object // I want this to map to the above object(s) | |
}); | |
export const User = mongoose.model<IUser>("User", UserSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment