Suppose you have a projective variety $\tilde{Y}$ on $\mathbb{P}^n$ defined by the zero locus of homogeneous polynomials $F_1,\dots,F_m$ (with all the hypotheses as you wish). And denote by $Y$ its affine cone as a subvariety of $X=\mathbb{C}^{n+1}-0$.
Also consider the following known exact sequences for the sheaf-theoretical restriction to $Y$ (of $(\mathcal{O}_X)|_Y-modules)$: \begin{align}\label{int1} \nonumber 0\rightarrow I_Y \rightarrow &\mathcal{O}_X \rightarrow (i_Y)_*(\mathcal{O}_Y) \simeq \mathcal{O}_X/_{I_Y} \rightarrow 0\\ 0\rightarrow (I_Y)|_Y \rightarrow &(\mathcal{O}_X)|_Y \rightarrow ((i_Y)_*(\mathcal{O}_Y))|Y \simeq \mathcal{O}_Y \rightarrow 0 , \end{align}
Question: When can I say that the global sections in $H^0(Y,(\mathcal{O}_X)|_Y)$ coincides with the resctriction to $Y$ of an element in $H^0(X,\mathcal{O}_X)$ ?
Maybe this is equivalent to ask the same for the global sections in $H^0(Y, \mathcal{O}_Y)$.