Open DrMaxNix opened 8 months ago
I has try fix it in https://github.com/go-gitea/gitea/pull/15924, but sadly looks no one think it's a bug :( . maybe need a beter design about how to limit repository number for org. or repo number limit will looks meaningless if all user can create orgs.
This is definitely a bug! The validation on the frontend does not match the validation in the backend! If the behaviour of the ui is actually wanted (which would be really weird), the backend validation would be wrong, which would not only still be a bug, but also a security problem!!!
Scenario
MAX_CREATION_LIMIT = 0
to prevent random new users from spamming our instanceDev
which hasCreate repositories
enabledProblem
Create Repository
is disabled in caseCanCreateRepo == false
: https://github.com/go-gitea/gitea/blob/5c91d7920f4aff08768e274269e211e926aa3d36/templates/repo/create.tmpl#L212CanCreateRepo
checks whether the user already has too many personal repos: https://github.com/go-gitea/gitea/blob/5c91d7920f4aff08768e274269e211e926aa3d36/models/user/user.go#L240-L251Create repositories
permission in their org!Solutions
CanCreateRepo
value should only influence creation of a personal repoNote that I was not able to reproduce the issue on the demo instance, because there is no repo count limit and also it seems like you can't create orgs there..
Screenshots
Trying to create a new repo
testrepo45
undertestorg
organization, note the banner telling me there is a limit:Submit button is disabled:
Repo create works anyway when enabling the submit button by hand:
Gitea Version
v1.21.9