-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
fix ui bug when user can't create repo but org can #15924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocking per chat in case this may be a breaking change.
@techknowlogick Would you please give more detail? Thanks. |
@a1012112796 I raised that concern on discord: Changing the behaviour would be a breaking change in permission handling, just take gitea.com for example: policy would need to be changed that users can't create organizations in order to keep the 5-repos-per-user limitation. |
Ok I stand corrected: edit: #12492 introduced the disabled button, but didn't touch on this topic either |
@noerw I see, so you means the org's repos number should be calculate as owner's repo, then if owner can't create repo, his org also can't create repo, Isn't it? In fact, gitea only check the org's repo number limt when create org repo, see here: gitea/modules/repository/create.go Lines 18 to 24 in 77fa714
and this pull request just fix ui logic to make it same with post handle, hasn't change the repo create logic in post handle. I wonder why it breake this logic ... |
This comment has been minimized.
This comment has been minimized.
follow go-gitea#12492, do same thing on repo migrate page - readd ``form.reach_limit_of_creation`` because it's still be used - part of go-gitea#15924 also Signed-off-by: a1012112796 <[email protected]>
This still be a wired design and I cannot accept that. |
@lunny That's out of the topic of this pull request. now I think we should make sure when a user can't create repo, should we allow this user to create repo for the org which can create repo? if yes, It's okay to merge this pull request, or it's a big problem and need rewrite many things ... |
Anything new to that? |
Please resolve the conflicts. |
379c7e5
to
383e713
Compare
@techknowlogick there is one |
if !canCreateRepo && ctx.Doer.ID == ctxUser.ID { | ||
orgs, has := ctx.Data["Orgs"].([]*organization.Organization) | ||
if has && len(orgs) > 0 { | ||
ctxUser = orgs[0].AsUser() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the first organizaiton?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the logic is still confusing. |
fix go-gitea#15504 Signed-off-by: a1012112796 <[email protected]>
383e713
to
3f0ed55
Compare
Asked by @blackshot , #15504 (comment) is it possible to improve this PR and get it merged in 1.17? |
But looks noone think this pull request is right. so I'd like close it. |
Hmm ... I haven't look into the details for it, just saw some discussions above, no idea about what is right. |
fix #15504