From 182684fd50dee1c92dba6654811980637f6e8dde Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 7 Dec 2007 22:58:49 +0000 Subject: wheelfortune: start checking permissions --- data/rbot/plugins/games/wheelfortune.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/data/rbot/plugins/games/wheelfortune.rb b/data/rbot/plugins/games/wheelfortune.rb index d0178c07..07238cb0 100644 --- a/data/rbot/plugins/games/wheelfortune.rb +++ b/data/rbot/plugins/games/wheelfortune.rb @@ -249,6 +249,14 @@ class WheelOfFortune < Plugin return end game = @games[ch] + + if m.botuser != game.manager and !m.botuser.permit?('wheelfortune::manage::other::add') + m.reply _("you can't add questions to the %{name} game on %{chan}") % { + :name => game.name, + :chan => p[:chan] + } + end + cat = p[:cat].to_s clue = p[:clue].to_s ans = p[:ans].to_s @@ -438,7 +446,12 @@ class WheelOfFortune < Plugin } return end - do_cancel(ch) + # is the botuser the manager or allowed to cancel someone else's game? + if m.botuser == game.manager or m.botuser.permit?('wheelfortune::manage::other::cancel') + do_cancel(ch) + else + m.reply _("you can't cancel the current game") + end end def do_cancel(ch) -- cgit v1.2.3