mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-04-26 20:49:11 +00:00
23 lines
680 B
JavaScript
23 lines
680 B
JavaScript
// @flow
|
|
import { type AppContext } from '../Roleypoly'
|
|
import { type Context } from 'koa'
|
|
import * as secureAs from './_security'
|
|
export default ($: AppContext) => ({
|
|
// i want RPC to be *dead* simple.
|
|
// probably too simple.
|
|
hello (_: Context, hello: string) {
|
|
return `hello, ${hello} and all who inhabit it`
|
|
},
|
|
|
|
testJSON (_: Context, inobj: {}) {
|
|
return inobj
|
|
},
|
|
|
|
testDecide: secureAs.decide($,
|
|
[ secureAs.root, () => { return 'root' } ],
|
|
[ secureAs.manager, () => { return 'manager' } ],
|
|
[ secureAs.member, () => { return 'member' } ],
|
|
[ secureAs.authed, () => { return 'authed' } ],
|
|
[ secureAs.any, () => { return 'guest' } ]
|
|
)
|
|
})
|