Skip to content

Instantly share code, notes, and snippets.

@glommer
Created November 11, 2022 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glommer/6821c784d137df7538cc98bb834d8403 to your computer and use it in GitHub Desktop.
Save glommer/6821c784d137df7538cc98bb834d8403 to your computer and use it in GitHub Desktop.
import { User } from "../models/User";
import { Action, RequestContext } from "@chiselstrike/api";
export default {
read: (user: User, ctx: RequestContext) => {
if (ctx.token && user.userId && user.userId == ctx.token['userId']) {
return Action.Allow;
} else {
return Action.Skip;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment