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

Use "read" value for General Access #18496

Merged
merged 5 commits into from
Feb 1, 2022
Merged

Conversation

Gusted
Copy link
Contributor

@Gusted Gusted commented Jan 31, 2022

  • On edit pages "general access"'s value is being set to .Team.AccessMode, this field always points to the current value of the team's permission, which is generally correct. But when the team had "admin" access, the general permission will also be set to "admin", which is incorrect as you want to set all individual fields to specific access permission.
  • Resolves Team Permission Table Bug #18483

- Currently the `.Team.AccessMode` is being used when editing a team, if
you want to admin -> General Access, the value of General Access is
"admin" which is incorrect.
- Resolves go-gitea#18483 (First bug mentioned)
@Gusted Gusted requested a review from lunny January 31, 2022 19:39
@Gusted Gusted added this to the 1.17.0 milestone Jan 31, 2022
@Gusted Gusted added type/bug issue/regression Issue needs no code to be fixed, only a description on how to fix it yourself theme/permissions labels Jan 31, 2022
@Gusted
Copy link
Contributor Author

Gusted commented Jan 31, 2022

Regression of: #17811

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 31, 2022
@Gusted Gusted added backport/done All backports for this PR have been created backport/v1.16 labels Jan 31, 2022
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 31, 2022
@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 31, 2022
@Gusted
Copy link
Contributor Author

Gusted commented Jan 31, 2022

Consider this message as reviews requested, as I'm not 100% sure if this should be the correct behavior(as general access could be write?) I would like @lunny's approval of stamp onto this PR before getting merged and causing another bug.

@lunny
Copy link
Member

lunny commented Feb 1, 2022

.Team.AccessMode point to the minial permission of all units. If all units are write, then it will be write. If there is one is read, then it will be read.

@codecov-commenter
Copy link

codecov-commenter commented Feb 1, 2022

Codecov Report

Merging #18496 (c678273) into main (80048c0) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #18496   +/-   ##
=======================================
  Coverage   46.25%   46.26%           
=======================================
  Files         842      842           
  Lines      121180   121180           
=======================================
+ Hits        56052    56064   +12     
+ Misses      58321    58310   -11     
+ Partials     6807     6806    -1     
Impacted Files Coverage Δ
modules/process/manager.go 81.36% <0.00%> (-1.87%) ⬇️
modules/queue/queue_bytefifo.go 47.60% <0.00%> (-1.85%) ⬇️
models/repo/repo.go 64.23% <0.00%> (-0.49%) ⬇️
services/pull/pull.go 39.78% <0.00%> (-0.47%) ⬇️
models/issue_comment.go 51.99% <0.00%> (+0.68%) ⬆️
modules/queue/workerpool.go 56.17% <0.00%> (+2.24%) ⬆️
modules/git/blame.go 71.59% <0.00%> (+2.27%) ⬆️
modules/git/utils.go 69.66% <0.00%> (+3.37%) ⬆️
modules/queue/queue_channel.go 84.90% <0.00%> (+3.77%) ⬆️
modules/git/repo_base_nogogit.go 74.50% <0.00%> (+3.92%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 80048c0...c678273. Read the comment docs.

@lunny lunny merged commit 7f2530e into go-gitea:main Feb 1, 2022
Gusted added a commit to Gusted/gitea that referenced this pull request Feb 1, 2022
zeripath pushed a commit that referenced this pull request Feb 1, 2022
zjjhot added a commit to zjjhot/gitea that referenced this pull request Feb 2, 2022
* giteaofficial/main: (37 commits)
  Collaborator trust model should trust collaborators (go-gitea#18539)
  Detect conflicts with 3way merge (go-gitea#18536)
  [skip ci] Updated translations via Crowdin
  Update 1.16.0 changelog to set go-gitea#17846 as breaking (go-gitea#18533)
  In docker rootless use $GITEA_APP_INI if provided (go-gitea#18524)
  revert to node14 for snapcraft
  Add `GetUserTeams` (go-gitea#18499)
  Fix review excerpt (go-gitea#18502)
  Update JS dependencies, fix lint (go-gitea#18389)
  add test coverage for original author conversion during migrations (go-gitea#18506)
  add gitea-fmt back (go-gitea#18526)
  Fix non-ASCII search on database  (go-gitea#18437)
  Use "read" value for General Access (go-gitea#18496)
  Fix for AvatarURL database type (go-gitea#18487)
  Remove go 1.15 support (go-gitea#18511)
  [skip ci] Updated translations via Crowdin
  Use `ImagedProvider` for gplus oauth2 provider (go-gitea#18504)
  build with node16 in snap (go-gitea#18508)
  point to s3 endpoint directly (go-gitea#18497)
  Fix OAuth Source Edit Page (go-gitea#18495)
  ...
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
- Currently the `.Team.AccessMode` is being used when editing a team, if
you want to admin -> General Access, the value of General Access is
"admin" which is incorrect.
- Resolves go-gitea#18483 (First bug mentioned)

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
@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
backport/done All backports for this PR have been created issue/regression Issue needs no code to be fixed, only a description on how to fix it yourself lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Team Permission Table Bug
7 participants