Skip to content

Instantly share code, notes, and snippets.

@danscan
Created January 25, 2016 16:55

Revisions

  1. danscan created this gist Jan 25, 2016.
    24 changes: 24 additions & 0 deletions policy.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    const db = {
    usersBySessionToken: {
    '1': {
    id: 1,
    name: 'Dan',
    },
    },

    postsById: {
    '2': {
    id: 2,
    author: 1,
    body: 'hey',
    },
    },

    getRequestUser(sessionToken) {
    return this.usersBySessionToken[sessionToken];
    },

    getPost(postId) {
    return this.postsById[postId];
    },
    };