How to set limited access to some portion of code in Git?

I have a few developers on my team and I need to restrict each one access to some portions of our codes. we are using self-hosted version of GitLab.

For example I want to limit programmer1 to just has access to folder1 and won’t be able to see or clone folder2 contents to his machine.

[RootFolder]
    -- folder1
         -- source.php
    -- folder2
         -- file.php
         -- image.jpg