"The world is your oyster" is a quote from Shakespeare's The Merry Wives of Windsor:
Falstaff: I will not lend thee a
penny.
Pistol: Why then the world's mine
oyster, Which I with sword will open.
Falstaff: Not a penny.
The original implication of the phrase is that Pistol is going to use violent means (sword) to steal his fortune (the pearl one finds in an oyster).
We inherit the phrase, absent its original violent connotation, to mean that the world is ours to enjoy.
It's an English adaptation of a Latin saying:
De gustibus non est disputandum.
Meaning literally regarding taste, there is no dispute. The phrase seems to be of medieval origin. The origin is accepted as Scholastic writings because of the grammar, which is atypical. A more faithful Latin rendering of the phrase might be:
De gustatibus non disputandum.
There's some uncertainty about whether gustus (gustibus) or gustatus (gustatibus) is more appropriate.
Best Answer
I found this earlier use of the phrase from a political poem in Volume 7 of Punch, 1844, which might indicate a law-enforcement origin: