That is partially incorrect; you can restrict writes via hooks but not reads; you'd need a workaround like submodules
Gitolite supports per-diectory/file write access natively, for gitlab you'd probably need to write your own.