Brief answer: See Stig Kanger's 1972 paper "Law and Logic" (Theoria 38, pp. 105-132).
Longer answer: Logical treatment of jurisprudence is, as it happens, at an incipient stage, though the idea is not novel - since someone called Leibniz has passed through this world:
We need a new logic in order to know degrees of probability, since this is necessary in judging the proofs of matters of fact and of morals, where there are unusually good reasons on both sides and we are concerned only to know on which side to tip the scales. But the art of weighing probabilities is not yet even partly explained, though it would be of great importance in legal matters and even in the management of business.
(Philosophical Papers and Letters: A Selection, 2nd ed. by L. E. Loemker, Synthese Historical Library, 1969, vol. 2., p. 260)
Leibniz linked logic and jurisprudence primarily by probability theory. Not surprising, for logic and jurisprudence meet not only at the point of an application of logic to jurisprudence, but also at their common interest in argument text as a self-standing object of study - its normative aspects, its prescriptive form, the importance of fine distinctions in meanings and concepts about what follows from what, and the like. Stephen Toulmin stresses this point to the extent of saying:
Logic (we may say) is generalised jurisprudence. Arguments can be compared with law-suits, and the claims we make and argue for in extra-legal contexts with claims made in the courts, while the cases we present in making good each kind of claim can be compared with each other.
(The Uses of Argument, updated edition, CUP, 2003, p. 7)
Hence, we should be more than cautious against oversimplifying matters, in particular, not be tempted to immediately employ deontic logic (meanwhile, which has its own foundational issues).
Returning to the proposition 'X has the right to do Y' as an example, we need a typology of rights amenable to formal treatment in the first place. Kanger bases his analysis on the jurist W. N. Hohfeld's conceptions proposed in his papers Some Fundamental Legal Conceptions as Applied in Judicial Reasoning 1913 and 1917 (both of them are freely available by Yale University on the website https://digitalcommons.law.yale.edu).
Very roughly, Kanger proposes to expand the standard deontic logic in accordance with his definitions of four simple types of rights, i.e., claim, power, immunity, and freedom, and its correlatives duty, liability, disability, and exposure (no-right), each relation of right, as each jural relation, involves two parties and a state of affairs between them.
An exposition of Kanger's formalisation is, I suppose, beyond the bounds of this question. Overall, setting out a shared framework for logic and law is an issue of ongoing research (see, for example, the JuriLog Project, https://anr.fr/Project-ANR-11-FRAL-0003) and, a text-book style explanation is yet to be available (Deontic Logic and Legal Systems by by P. E. Navarro and J. L. Rodríguez, CUP, 2014, may be helpful in this respect).