user-center-acl

0.0.3 • Public • Published

user-center-acl —— user-center鉴权拓展

Quick Start

install

  $ yarn add user-center-auth

usage

// in config.js
{
  extension: {
    'user-center-acl': {
      enable: true,
      module: require('user-center-auth'),
      config: {
        aclUrl: 'your-user-center-acl-path'
      }
    }
  },
}


// in controller
exports.your_controller = async (req, cb) => {
  const isAllow = await req.isAllow(req, 'resource', 'operation');
  // no auth
  if(!isAllow)
    return cb('NO_AUTH');

  // do something if auth ...
}

Readme

Keywords

none

Package Sidebar

Install

npm i user-center-acl

Weekly Downloads

2

Version

0.0.3

License

ISC

Unpacked Size

11.2 kB

Total Files

4

Last publish

Collaborators

  • gorgear