Skip to content
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

Fix new team #18212

Merged
merged 2 commits into from
Jan 8, 2022
Merged

Fix new team #18212

merged 2 commits into from
Jan 8, 2022

Conversation

lunny
Copy link
Member

@lunny lunny commented Jan 8, 2022

Fix bug caused by #17811

@lunny lunny added type/bug skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. labels Jan 8, 2022
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Jan 8, 2022
Copy link
Contributor

@zeripath zeripath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a feeling we should simplify this and remove the MaxPerm thing as it appears kinda confusing. however this is a good bug fix.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 8, 2022
Copy link
Member

@noerw noerw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as per above. check the inverse or otherwise make sure

  • unset unit.Type doesn't grant admin access
  • later added values of unit.Type don't grant admin access

edit: tbh, I didn't thoroughly check the broader context of that code, it just seems like the func can easily be used in other contexts where assumptions don't hold. So maybe it's not that dangerous.

@6543 6543 added this to the 1.16.0 milestone Jan 8, 2022
@lunny
Copy link
Member Author

lunny commented Jan 8, 2022

as per above. check the inverse or otherwise make sure

  • unset unit.Type doesn't grant admin access
  • later added values of unit.Type don't grant admin access

edit: tbh, I didn't thoroughly check the broader context of that code, it just seems like the func can easily be used in other contexts where assumptions don't hold. So maybe it's not that dangerous.

This function will return the max permission that this unit could be assigned to. It's not about the real permission. It's just a convenient to let UI know about how to show the unit.

@zeripath
Copy link
Contributor

zeripath commented Jan 8, 2022

As I said in my approving comment I think this is fairly badly named and we should really rename this - but for the moment this is a reasonable bug fix.

@wxiaoguang
Copy link
Contributor

We can leave more comments here, and it won't confuse developers in future, and we can leave a TODO here to tell all readers how to continue to improve.

@zeripath zeripath merged commit 23f5a34 into go-gitea:main Jan 8, 2022
@lunny lunny deleted the lunny/fix_new_team branch January 8, 2022 15:28
zjjhot pushed a commit to zjjhot/gitea that referenced this pull request Jan 9, 2022
* 'main' of https://github.com/go-gitea/gitea:
  Fix typos in docs/content (go-gitea#18215)
  [skip ci] Updated licenses and gitignores
  In the Organization member page, 2fa column is too narrow for Simplified Chinese and Chinese Traditional. (go-gitea#18213)
  Fix new team (go-gitea#18212)
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants