From 297c80c7632e76e5c5a55cabad57154706911b57 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Mon, 3 Nov 2008 22:33:19 +0100 Subject: script plugin: per-script permissions --- data/rbot/plugins/script.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'data/rbot') diff --git a/data/rbot/plugins/script.rb b/data/rbot/plugins/script.rb index e3e718a7..762613d4 100644 --- a/data/rbot/plugins/script.rb +++ b/data/rbot/plugins/script.rb @@ -52,6 +52,9 @@ class ScriptPlugin < Plugin name = m.message.split.first if m.address? and @commands.has_key?( name ) + auth_path = "script::run::#{name}".intern + return unless @bot.auth.allow?(auth_path, m.source, m.replyto) + code = @commands[name].code.dup.untaint # Convenience variables, can be accessed by scripts: @@ -172,6 +175,7 @@ plugin = ScriptPlugin.new plugin.default_auth( 'edit', false ) plugin.default_auth( 'eval', false ) plugin.default_auth( 'echo', false ) +plugin.default_auth( 'run', true ) plugin.map 'script add -f :name *code', :action => 'handle_add_force', :auth_path => 'edit' plugin.map 'script add :name *code', :action => 'handle_add', :auth_path => 'edit' -- cgit v1.2.3