hubot-archive / hubot-auth

Assign roles to users and restrict command access in other scripts
149 stars 54 forks source link

Add feature to support id and name in HUBOT_AUTH_ADMIN #48

Closed sebastiandero closed 7 years ago

sebastiandero commented 7 years ago

I think the above mentioned feature would make hubot-auth alot more intuitive. The feature would be quite simple to implement aswell, instead of using this:

class Auth
    isAdmin: (user) ->
      user.id.toString() in admins

using this would provide username support:

class Auth
    isAdmin: (user) ->
      (user.id.toString() in admins) or (user.name.toString() in admins)

Please think about it, i will provide and link a pull request aswell

sebastiandero commented 7 years ago

Pullrequest for the feature: #49

sebastiandero commented 7 years ago

Support is insecure since one can spoof their name on some adapters