Just to be clear, in the US you must be an inventor to file. You can't take someone else's invention, once publicly disclosed, and then patent that within the one year period. But if two people have same invention the first to file usually has precedence.
Of course in practice there are thousands and thousands of trash patents but technically those are the rules.