def permission?(user, level, server)
      determined_level = if user.webhook? || server.nil?
                           0
                         else
                           user.roles.reduce(0) do |memo, role|
                             [@permissions[:roles][role.id] || 0, memo].max
                           end
                         end

      [@permissions[:users][user.id] || 0, determined_level].max >= level
    end
def permission?(user, level, server)
      determined_level = if user.webhook? || server.nil?
                           0
                         else
                           user.roles.reduce(0) do |memo, role|
                             [@permissions[:roles][role.id] || 0, memo].max
                           end
                         end

      [@permissions[:users][user.id] || 0, determined_level].max >= level
    end
Check if a user has permission to do something
 @param user [User] The user to check
 @param level [Integer] The minimum permission level the user should have (inclusive)
 @param server [Server] The server on which to check
 @return [true, false] whether or not the user has the given permission