lib/slack/smart-bot/commands/general/deny_access.rb in slack-smart-bot-1.14.2 vs lib/slack/smart-bot/commands/general/deny_access.rb in slack-smart-bot-1.15.0
- old
+ new
@@ -2,10 +2,10 @@
def deny_access(user, command_id)
save_stats(__method__)
not_allowed = ['hi_bot', 'bye_bot', "allow_access", "deny_access", "get_bot_logs", "add_routine", "pause_bot", "pause_routine", "remove_routine", "run_routine", "start_bot",
"start_routine", "delete_message", "update_message", "send_message", "kill_bot_on_channel", "exit_bot", "notify_message", "publish_announcements", "set_general_message",
"set_maintenance", 'bot_help', 'bot_rules']
- if !is_admin?(user.name)
+ if !is_admin?(user)
respond "Only admins of this channel can use this command. Take a look who is an admin of this channel by calling `see admins`"
elsif Thread.current[:dest][0] == "D"
respond "This command cannot be called from a DM"
elsif not_allowed.include?(command_id)
respond "Sorry but the access for `#{command_id}` cannot be changed."