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

Branch protection affects wiki write permission #7561

Closed
2 of 7 tasks
maliffi opened this issue Jul 22, 2019 · 0 comments · Fixed by #7580
Closed
2 of 7 tasks

Branch protection affects wiki write permission #7561

maliffi opened this issue Jul 22, 2019 · 0 comments · Fixed by #7580
Labels
Milestone

Comments

@maliffi
Copy link

maliffi commented Jul 22, 2019

  • Gitea version (or commit ref): 1.9.0+rc2-2-g91e24a3a1
  • Git version: 2.22.0
  • Operating system:
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
2019/07/22 07:48:31 .../xorm/session_get.go:99:nocacheGet() [I] [SQL] SELECT `id`, `repo_id`, `branch_name`, `can_push`, `enable_whitelist`, `whitelist_user_i_ds`, `whitelist_team_i_ds`, `enable_merge_whitelist`, `merge_whitelist_user_i_ds`, `merge_whitelist_team_i_ds`, `approvals_whitelist_user_i_ds`, `approvals_whitelist_team_i_ds`, `required_approvals`, `created_unix`, `updated_unix` FROM `protected_branch` WHERE `repo_id`=? AND `branch_name`=? LIMIT 1 []interface {}{20, "master"}
2019/07/22 07:48:31 ...ters/private/hook.go:107:HookPreReceive() [W] Forbidden: User 23 cannot push to protected branch: master in 824713418768:Integrations/pvf
2019/07/22 07:48:31 models/wiki.go:222:updateWikiPage() [E] exit status 1 - remote: Gitea: protected branch master can not be pushed to
        To /data/git/repositories/integrations/pvf.wiki.git
         ! [remote rejected] 7bd77abfa7580be79b51fa4490fafefc697440d0 -> master (pre-receive hook declined)
        error: failed to push some refs to '/data/git/repositories/integrations/pvf.wiki.git'

2019/07/22 07:48:31 routers/repo/wiki.go:425:EditWikiPost() [E] EditWikiPage: Push: exit status 1 - remote: Gitea: protected branch master can not be pushed to
        To /data/git/repositories/integrations/pvf.wiki.git
         ! [remote rejected] 7bd77abfa7580be79b51fa4490fafefc697440d0 -> master (pre-receive hook declined)
        error: failed to push some refs to '/data/git/repositories/integrations/pvf.wiki.git'

Description

Got error 500 when you try to modify an existing pag einto Wiki or to create a new one.
The problem occurs only if on the default branch (usually "master") has active protection and the user attempting to modify the wiki page does not have permission to push/merge on master.
If the user permissions are modified to allow him to push on master, then he is able to modify/create wiki pages.

@lunny lunny added the type/bug label Jul 23, 2019
@lunny lunny added this to the 1.9.0 milestone Jul 23, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants