security(git_server): do not allow strangers to push on unlisted repositories...@@ -51,12 +51,11 @@ const makeAuthorizationResolver: ServiceMethodFactory<
return false;
}
- if (
- repo.visibility === ResourceVisibility.PUBLIC ||
- repo.visibility === ResourceVisibility.UNLISTED
- ) {
+ if (repo.visibility === ResourceVisibility.PUBLIC) {
return true;
} else {
+ // TODO:
+ // allow read-only for unlisted users without auth, but write behind auth.
return !!(
(org.ownerId === user.id ||
org.memberships.find((m) => m.id === user.id)) &&