-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The hubot-auth module doesn't work very well in combination with hubot-slack, mainly because of slackapi/hubot-slack#326 We don't make extensive use of hubot-auth roles, so replace them with a thin wrapper over the user profile data provided by Slack so that we can distinguish between admins/non-admins and staff/guests.
- Loading branch information
1 parent
e89bdfc
commit deb8b23
Showing
5 changed files
with
25 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
[ | ||
"hubot-auth", | ||
"hubot-redis-brain", | ||
"hubot-tell" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Description: | ||
// Provide easy access to Slack user info. | ||
// | ||
// Author: | ||
// Nick Stenning | ||
|
||
'use strict'; | ||
|
||
class Auth { | ||
isAdmin(user) { | ||
return user.is_admin | ||
} | ||
|
||
isStaff(user) { | ||
return !(user.is_restricted || user.is_ultra_restricted) | ||
} | ||
} | ||
|
||
module.exports = function (robot) { | ||
robot.auth = new Auth(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.