# File lib/rbot/botuser.rb, line 871
      def permit?(user, cmdtxt, channel=nil)
        if user.class <= BotUser
          botuser = user
        else
          botuser = irc_to_botuser(user)
        end
        cmd = cmdtxt.to_irc_auth_command

        chan = channel
        case chan
        when User
          chan = "?"
        when Channel
          chan = chan.name
        end

        allow = nil

        allow = botuser.permit?(cmd, chan) if chan
        return allow unless allow.nil?
        allow = botuser.permit?(cmd)
        return allow unless allow.nil?

        unless botuser == everyone
          allow = everyone.permit?(cmd, chan) if chan
          return allow unless allow.nil?
          allow = everyone.permit?(cmd)
          return allow unless allow.nil?
        end

        raise "Could not check permission for user #{user.inspect} to run #{cmdtxt.inspect} on #{chan.inspect}"
      end