Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: github/hubot-scripts
...
head fork: github/hubot-scripts
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 12 additions and 11 deletions.
  1. +12 −11 src/scripts/auth.coffee
View
23 src/scripts/auth.coffee
@@ -1,20 +1,21 @@
# Auth allows you to assign roles to users which can be used by other scripts to restrict access to Hubot commands
#
+# <user> has <role> role - Assigns a role to a user
+# <user> doesn't have <role> role - Removes a role from a user
+# what role does <user> have - Find out what roles are assigned to a specific user
+# who has admin role - Find out who's an admin and can assign roles
+#
# Environment variables:
-# HUBOT_AUTH_ADMIN - the user(s) who can assign roles to other users, comma-separated
+# * HUBOT_AUTH_ADMIN
#
-# Use in your script
-# - Call the method: robot.Auth.hasRole('<user>','<role>')
-# - returns bool true or false
+# Use in your script:
+# * Call the method: robot.Auth.hasRole('<user>','<role>')
+# * returns bool true or false
#
# Notes:
-# - the 'admin' role can only be assigned through the environment variable
-# - roles are all transformed to lower case
+# * the 'admin' role can only be assigned through the environment variable
+# * roles are all transformed to lower case
#
-# <user> has <role> role - Assigns a role to a user
-# <user> doesn't have <role> role - Removes a role from a user
-# what role does <user> have - Find out what roles are assigned to a specific user
-# who has admin role - Find out who's an admin and can assign roles
# hubot alex has role op
@@ -76,4 +77,4 @@ module.exports = (robot) ->
msg.reply "#{name} has the following roles: " + user.roles + isAdmin + "."
robot.respond /who has admin role\?*$/i, (msg) ->
- msg.reply "The following people have the 'admin' role: #{admin.split(',')}"
+ msg.reply "The following people have the 'admin' role: #{admin.split(',')}"

No commit comments for this range

Something went wrong with that request. Please try again.