lib/slack/smart-bot/commands/general/use_rules.rb in slack-smart-bot-1.6.0 vs lib/slack/smart-bot/commands/general/use_rules.rb in slack-smart-bot-1.6.1

- old
+ new

@@ -8,10 +8,11 @@ # help: you need to be part of that channel to be able to use the rules. # help: def use_rules(dest, channel, user, dchannel) save_stats(__method__) get_bots_created() - if config[:allow_access].key?(__method__) and !config[:allow_access][__method__].include?(user.name) and !config[:allow_access][__method__].include?(user.id) + if config[:allow_access].key?(__method__) and !config[:allow_access][__method__].include?(user.name) and !config[:allow_access][__method__].include?(user.id) and + (!user.key?(:enterprise_user) or ( user.key?(:enterprise_user) and !config[:allow_access][__method__].include?(user[:enterprise_user].id))) respond "You don't have access to use this command, please contact an Admin to be able to use it: <@#{config.admins.join(">, <@")}>" else #todo: add pagination for case more than 1000 channels on the workspace channels = client.web_client.conversations_list( types: "private_channel,public_channel",