* AutoOp plugin: adapted to the new IRC framework.
* AutoOp plugin: trigger autoop on nick change too.
+ * New Auth Framework: allow? method now informs a user when they don't
+ have permission to do what they asked for.
2006-08-10 Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
str << ">"\r
end\r
\r
+ # In strings\r
+ def to_s\r
+ @username\r
+ end\r
+\r
# Convert into a hash\r
def to_hash\r
{\r
raise "Could not check permission for user #{user.inspect} to run #{cmdtxt.inspect} on #{chan.inspect}"\r
end\r
\r
- # Checks if command _cmd_ is allowed to User _user_ on _chan_\r
+ # Checks if command _cmd_ is allowed to User _user_ on _chan_, optionally\r
+ # telling if the user is authorized\r
+ #\r
def allow?(cmdtxt, user, chan=nil)\r
- permit?(user, cmdtxt, chan)\r
+ if permit?(user, cmdtxt, chan)\r
+ return true\r
+ else\r
+ # cmds = cmdtxt.split('::')\r
+ # @bot.say chan, "you don't have #{cmds.last} (#{cmds.first}) permissions here" if chan\r
+ @bot.say chan, "#{user}, you don't have '#{cmdtxt}' permissions here" if chan\r
+ return false\r
+ end\r
end\r
\r
end\r