Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Limiting uses' access in a monorepo

If you're working on a large monorepo, and you wanna limit some users' access to specific directories (packages) in that monorepo, is there a better way to do this than using git submodules?

For example if you have that monorepo structure

- packages
  - package A
  - package B
  - package C
  - common

And you wanna allow a user to read and write to package A and common only. Is using git submodules the best way to achieve this?

like image 572
Amr Elsekilly Avatar asked Oct 15 '22 09:10

Amr Elsekilly


1 Answers

With Git, read access limitation means a repository is "private" for some users.
And a monorepo with submodules:

  • is not really a monorepo
  • would fail cloning for those users, because it would try cloning each submodules

One authorization system which can limit at least write access per folder is gitolite (if you have control of your remote server).
Limiting read access inside one (mono)repo is tricky (or impossible).

like image 81
VonC Avatar answered Oct 20 '22 05:10

VonC