Skip to content

For Gitlab resolve group-inherited project permissions for repos - #7172

Merged
6543 merged 4 commits into
woodpecker-ci:mainfrom
YouCD:fix/gitlab-group-inherited-permissions
Oct 8, 2026
Merged

6543 merged 4 commits into
woodpecker-ci:mainfrom
YouCD:fix/gitlab-group-inherited-permissions

Conversation

@YouCD

@YouCD YouCD commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

The projects list API returns permissions: null for some projects, so the
code falls back to GetInheritedProjectMember to resolve the user's access
level. For projects the user reaches only via a parent group, that endpoint
returns 404 (the user is not a direct project member) and the project was
silently skipped.

On that 404, fetch the full project with GetProject and use its embedded
permissions (group_access / project_access) instead. If the full-project
lookup also fails, keep the list data (access level 0) rather than failing the
whole page; the repo is simply filtered out later for lacking write access.

This makes group-inherited projects (e.g. maintainers of a parent group) show
up in the repository list.

Related: #6991 (closes #6882)

The projects list API returns `permissions: null` for some projects, so the
code falls back to `GetInheritedProjectMember` to resolve the user's access
level. For projects the user reaches only via a parent group, that endpoint
returns 404 (the user is not a direct project member) and the project was
silently skipped.

On that 404, fetch the full project with `GetProject` and use its embedded
`permissions` (`group_access` / `project_access`) instead. If the full-project
lookup also fails, keep the list data (access level 0) rather than failing the
whole page; the repo is simply filtered out later for lacking write access.

This makes group-inherited projects (e.g. maintainers of a parent group) show
up in the repository list.

Related: woodpecker-ci#6991 (closes woodpecker-ci#6882)
@6543 6543 added bug Something isn't working forge/gitlab gitlab forge related labels Oct 1, 2026
@6543

6543 commented Oct 1, 2026

Copy link
Copy Markdown
Member

@YouCD can you format the code then the linter would be happy :)

@6543
6543 merged commit 9be8fec into woodpecker-ci:main Oct 8, 2026
6 of 7 checks passed
@woodpecker-bot woodpecker-bot mentioned this pull request Oct 8, 2026
1 task
@YouCD
YouCD deleted the fix/gitlab-group-inherited-permissions branch October 9, 2026 01:38
@6543 6543 changed the title 🐛 fix(gitlab): resolve group-inherited project permissions in Repos() For Gitlab resolve group-inherited project permissions in Repos() Oct 12, 2026
@6543 6543 changed the title For Gitlab resolve group-inherited project permissions in Repos() For Gitlab resolve group-inherited project permissions for repos Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working forge/gitlab gitlab forge related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitLab forge: Repos() N+1 API calls break login for admin users

2 participants