This is kinda a confusing question because if some files for custody ofyou, it doesn't matter if you give them permission to or not. Also, if your parents give someone consent to take custody rights of you, you cannot say.
I'd say a simple answer to you question is 18 years of age.