Created
November 11, 2022 23:13
-
-
Save glommer/a6baadbf92c4462e6cc0f2751d3107a5 to your computer and use it in GitHub Desktop.
This file contains 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 { User } from "../models/User"; | |
import { Action, RequestContext } from "@chiselstrike/api"; | |
export default { | |
create: (user: User, ctx: RequestContext) => { | |
if (ctx.token && user.userId && user.userId == ctx.token['userId']) { | |
return Action.Allow; | |
} else { | |
return Action.Deny; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment