totallymike / ircnode

Extensible IRC bot written with node.js
https://github.com/totallymike/ircnode/wiki
MIT License
4 stars 2 forks source link

auth levels #19

Open totallymike opened 12 years ago

totallymike commented 12 years ago

make auth into an array, so plugins can add their own authorizations for specific events and such, and then change auth checks to directly ask for a specific level or auth instead of using is_admin or is_owner.

sigv commented 12 years ago

It would not be hard to implement it now as there is not much code to change. It is simply the matter of using irc.check_level(nick, 'owner', callback) instead of irc.is_owner(nick, callback). All the plugins that use the auth levels would need to change that, but it would be good in the long run as later on it would be even harder to change those.

sigv commented 12 years ago

The plugin API documentation has been updated. It now includes that irc.check_level(nick, level, callback) is better as irc.is_level(nick, callback) is under discussion for removal.

sigv commented 12 years ago

The basic functions have been replaced, but there are still changes to implement. One of them is that !set_auth currently only accepts 'user', 'admin' and 'owner' as valid values here. It should search through the array. That also means that 'user' or a similar value would need to be added to the auth users array on master.