Files: d2b5693b01842e3376dae3c3cf5c579e03e490c4 / plugins / master.js
382 bytesRaw
1 | // master plugin |
2 | // allows you to define "master" IDs in the config |
3 | // which are given the full rights of the local main ID |
4 | module.exports = function (api, opts) { |
5 | var masters = [api.id].concat(opts.master).filter(Boolean) |
6 | api.auth.hook(function (fn, args) { |
7 | var id = args[0] |
8 | var cb = args[1] |
9 | cb(null, ~masters.indexOf(id) ? {allow: null, deny: null} : null) |
10 | }) |
11 | } |
12 |
Built with git-ssb-web