summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-12-07 22:58:49 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-12-07 22:58:49 +0000
commit182684fd50dee1c92dba6654811980637f6e8dde (patch)
treeb6f632a77ff00c0a6b4ae4823a4ec5bfb7463d8c
parentb77ef7652c9856a4b52fa2534519e1dd61de75b9 (diff)
wheelfortune: start checking permissions
-rw-r--r--data/rbot/plugins/games/wheelfortune.rb15
1 files changed, 14 insertions, 1 deletions
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)