• Stars
    star
    148
  • Rank 249,911 (Top 5 %)
  • Language
    CoffeeScript
  • Created over 10 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Assign roles to users and restrict command access in other scripts

Hubot: hubot-auth

Build Status

Assign roles to users and restrict command access in other scripts.

See src/auth.coffee for full documentation.

Installation

Add hubot-auth to your package.json file:

npm install --save hubot-auth

Add hubot-auth to your external-scripts.json:

["hubot-auth"]

Run npm install

Sample Interaction

user1>> hubot user2 has jester role
hubot>> OK, user2 has the jester role.

Sample Usage

Restricting commands

module.exports = (robot) ->
  # Command listener
  robot.respond /some command/i, (msg) ->
    role = 'some-role'
    user = robot.brain.userForName(msg.message.user.name)
    return msg.reply "#{name} does not exist" unless user?
    unless robot.auth.hasRole(user, role)
      msg.reply "Access Denied. You need role #{role} to perform this action."
      return
    # Some commandy stuff
    msg.reply 'Command done!'

Example Interaction

user2>> hubot some command
hubot>> Access Denied. You need role some-role to perform this action.
user1>> hubot user2 has some-role role
hubot>> OK, user2 has the some-role role.
user2>> hubot some command
hubot>> Command done!

More Repositories

1

hubot-heroku-keepalive

A hubot script that keeps the hubot Heroko web dyno alive
CoffeeScript
206
star
2

hubot-google-images

A hubot script that interacts with the Google Images API
CoffeeScript
123
star
3

hubot-business-cat

Business cat is summoned when business jargon is used
CoffeeScript
105
star
4

packages

DEPRECATED, see README.md for details
82
star
5

hubot-pager-me

PagerDuty integration for Hubot
JavaScript
75
star
6

hubot-google-translate

Allows Hubot to know many languages using Google Translate
CoffeeScript
63
star
7

hubot-google-hangouts

/hangout me command for Hubot
CoffeeScript
63
star
8

hubot-github-repo-event-notifier

Notifies about any GitHub repo event available via webhook.
CoffeeScript
57
star
9

hubot-example

An example script package for Hubot
54
star
10

hubot-youtube

A hubot script for searching YouTube
JavaScript
35
star
11

hubot-devops-reactions

CoffeeScript
28
star
12

hubot-sentimental

A hubot adapter for tracking happiness levels of users in an IRC channel via the Sentimental database
CoffeeScript
28
star
13

hubot-tell

Hubot plugin to send a user a message the next time they are present in the room
CoffeeScript
27
star
14

hubot-circleci

Hubot CircleCI integration
CoffeeScript
27
star
15

hubot-darksky

A script to grab the forecast information from Dark Sky for Hubot
CoffeeScript
26
star
16

hubot-seen

A hubot script that tracks when/where users were last seen.
CoffeeScript
24
star
17

hubot-pugme

Pugme is the most important hubot script
CoffeeScript
22
star
18

hubot-chef

A hubot chef/knife wrapper script
CoffeeScript
22
star
19

hubot-ambush

A hubot script to leave messages for people
CoffeeScript
20
star
20

hubot-http-status

HTTP Status/Error lookup for Hubot
CoffeeScript
19
star
21

hubot-thank-you

A hubot script that accepts your thanks
CoffeeScript
18
star
22

hubot-qr

Turn any url into a QR Code
CoffeeScript
18
star
23

hubot-codinglove

Hubot script to display meme from http://thecodinglove.com and http://lesjoiesducode.tumblr.com
CoffeeScript
17
star
24

hubot-yubikey-invalidation

Sends any accidental YubiKey presses to Yubico so they are invalidated
CoffeeScript
17
star
25

hubot-thesimpsons

A Simpsons Quote and Image Generator for Hubots.
CoffeeScript
17
star
26

hubot-shipit

A hubot script that provides easy access to the shipit squirrel and its kin
CoffeeScript
16
star
27

hubot-slack-invite-request

DEPRECATED β€” Use slack-invite-request instead:
HTML
14
star
28

hubot-victory

Time to see some victorious images!
CoffeeScript
13
star
29

hubot-fliptable

Sometimes you just want to flip a damn table.
JavaScript
13
star
30

hubot-basecamp

Expands Basecamp URLs in chat with more useful information.
CoffeeScript
13
star
31

hubot-reaction

CoffeeScript
12
star
32

hubot-explainshell

A quick way to get a link to explainshell
CoffeeScript
10
star
33

hubot-mailchimp

Mailchimp hubot script as an NPM package
JavaScript
8
star
34

hubot-motivate

A port of http://motivate.im/
CoffeeScript
8
star
35

hubot-principles

Hubot script that gives out advise about relationships and communication
CoffeeScript
8
star
36

hubot-freshdesk

Freshdesk support tickets integration right into your company chat room.
CoffeeScript
7
star
37

hubot-partyline

Decentralized P2P partyline support for Hubot
CoffeeScript
7
star
38

hubot-heroku-deploy-notifier

A hubot script that notifies of heroku app deploys
CoffeeScript
7
star
39

hubot-diabetes

A diabetes script package for Hubot.
CoffeeScript
7
star
40

hubot-2048

A 2048 Game Engine for Hubot
CoffeeScript
6
star
41

hubot-worldcup

CoffeeScript
6
star
42

hubot-darts

CoffeeScript
5
star
43

hubot-ttc-alerts

CoffeeScript
5
star
44

hubot-nationalrail

Get National Rail Live departure information
CoffeeScript
4
star
45

hubot-uptimerobot

A hubot script to list/add monitors for the Uptime Robot service.
CoffeeScript
4
star
46

hubot-cute-me

CoffeeScript
4
star
47

hubot-gh-token

Stores GitHub Personal Access Tokens in Hubot's brain
CoffeeScript
4
star
48

hubot-gh-issues

Hubot interface for GitHub issues
CoffeeScript
4
star
49

hubot-whiteboardcleaner

Automatically optimise photos of your whiteboard
CoffeeScript
4
star
50

hubot-express

experimental express provider
CoffeeScript
3
star
51

hubot-statuscake

Use hubot to send StatusCake status messages to your chat room.
CoffeeScript
3
star
52

hubot-pagerduty-github

Deprecated. See link...
CoffeeScript
3
star
53

hubot-ghe

Access your GitHub Enterprise instance through Hubot.
CoffeeScript
3
star
54

hubot-assembla

hubot script for interacting with Assembla API
CoffeeScript
3
star
55

hubot-chartbeat

Hubot: Chartbeat Script
CoffeeScript
2
star
56

hubot-di

Get currently playing tracks from DI.fm
CoffeeScript
2
star
57

hubot-github-hooks

Add and remove GitHub repository service hooks (only Campfire at the minute)
CoffeeScript
2
star
58

hubot-euphemism

CoffeeScript
2
star
59

hubot-dynstatus

A hubot script to parse the RSS status page for dyndns
CoffeeScript
2
star
60

hubot-freshdesk-ticket-notifier

A hubot script for tracking any webhook events from the Freskdesk support tool.
CoffeeScript
2
star
61

hubot-bikeshed

Hubot has an opinion on your bikeshed color
CoffeeScript
2
star
62

hubot-hearthstone

CoffeeScript
1
star
63

hubot-andrews-and-arnold

Get your ISP Quota from Andrews & Arnold's API
CoffeeScript
1
star
64

hubot-timezoneio

Hubot interface for timezone.io
CoffeeScript
1
star
65

owners

DEPRECATED, see https://github.com/hubot-scripts/packages/blob/master/README.md
1
star