# hubot-acl

> A hubot script for access control list

Latest version **0.0.3** (published 2015-03-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install hubot-acl
pnpm add hubot-acl
yarn add hubot-acl
bun add hubot-acl
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2015-03-25 |
| First published | 2015-03-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| Author | tily |
| Maintainers | tily |
| Keywords | hubot, hubot-scripts |

## Links

- npm: https://www.npmjs.com/package/hubot-acl
- Repository: https://github.com/hubot-scripts/hubot-acl
- Issues: https://github.com/hubot-scripts/hubot-acl/issues
- npm.io page: https://npm.io/package/hubot-acl

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) ^3.5.0
- [coffee-script](https://npm.io/package/coffee-script.md) ~1.6

## Recent versions

- 0.0.3 (latest) — 2015-03-25
- 0.0.2 — 2015-03-24
- 0.0.1 — 2015-03-21
- 0.0.0 — 2015-03-21

## README

# hubot-acl

A hubot script for access control list.

See [`src/acl.coffee`](src/acl.coffee) for full documentation.

See http://qiita.com/tily/items/71fff32e928ae9caf070 for Japanese README.

## Installation

In hubot project repo, run:

`npm install hubot-acl --save`

Then add **hubot-acl** to your `external-scripts.json`:

```json
["hubot-acl"]
```

## Usage

Catch `acl` event to define your ACL in your hubot script.

```coffee
module.exports = (robot)->
  robot.on 'acl', (order, allow, deny)->
    # your acl settings
```

ACL can be defined in apache.conf-like style.

### Whitelisting

```coffee
robot.on 'acl', (order, allow, deny)->
  order deny, allow
  deny text: /.*/
  allow id: [1], text: /.*/
  allow id: [2], text: /^jenkins/
  allow id: [3], text: /^jenkins (list|last|describe)/
```

* all users are not allowed to execute all commands by default
* user (id=1) is allowed to execute all commands
* user (id=2) is allowed to execute commands which begin with `jenkins`
* user (id=3) is allowed to execute `jenkins` read only commands (list, last, desribe)

### Blacklisting

```coffee
robot.on 'acl', (order, allow, deny)->
  order allow, deny
  allow text: /.*/
  deny name: ['bay4k', 'manny'], text: /^jenkins/
  deny name: ['sticky'], text: /^jenkins (b|build)/
```

* all users are allowed to execute all commands by default
* user (whose name is `bay4k` or `manny`) are not allowed to execute commands which begin with `jenkins`
* user (whose name is `sticky`) is not allowed to execute `jenkins` build commands (b, build)

## working with hubot-acl

```coffee
robot.on 'acl', (order, allow, deny)->
  order deny, allow
  deny text: /.*/
  allow role: ['admin'], text: /.*/
  allow role: ['jenkins'], text: /^jenkins/
  allow role: ['jenkins-readonly'], text: /^jenkins (list|last|describe)/
```

## Sample Interaction

```
Hubot> Hubot jenkins build hoge
bes: Error: you are not allowed to execute that command
```

---
_Source: https://npm.io/package/hubot-acl · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
