Skip to content

git: Apply sub-repo permissions to git.ReadDir and git.Stat

Administrator requested to merge ao/git-read-dir-subrepo-perms into main

Created by: sashaostrikov

I am not really sure about whether initialisation of authz.DefaultSubRepoPermsChecker is in the right place.

Another thing is that I initially thought to add filtering in lsTree function, but later I realised that it can lead to some bugs because git.Stat uses first fs.FileInfo element out of an array returned from lsTree and this can probably be shifted after the filtering is applied.

And due to the fact that both git.Stat and git.ReadDir depend on lsTree, I decided to open a single PR for both these commands. That's why this PR still contain both commands at once, I hope this is not the problem. If it is, I can separate them after I am back.

UPD: now this PR is ready for review

Closes https://github.com/sourcegraph/sourcegraph/issues/28267 and https://github.com/sourcegraph/sourcegraph/issues/28265

Merge request reports

Loading