Socket
Socket
Sign inDemoInstall

dude-permissions

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dude-permissions

Trigger `listen` only of the requesting user has permission


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

bolt-permissions

Setup permissions in initialize:

export default bot => {
  bot.config = {
    permissions: {
      admins: ['mahdi', 'milani'],
      designers: ['ehsan', 'ali', 'mohsen'],

      options: {
        grant: ['admins']
      }
    }
  };
}

Now, pass permissions in params of listen:

bot.listen(/config/i, message => {
  console.log('You are an admin! You have access!');
}, { permissions: ['admins'] });

grant, deny

Users specified in the options.grant and options.deny array are given the permission to grant or deny a user to a permission group. Enabled by default for the admins group.

Example:

grant milani admin
deny ehsan designer

To disable the commands:

bot.config.permissions = {
  options: {
    grant: false,
    deny: false
  }
}

FAQs

Package last updated on 18 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc