mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-05 07:08:41 +00:00
fix: apply permissions when flatPermissions enabled (#1603)
Closes #1582 When `WOODPECKER_FLAT_PERMISSIONS=true` workaround is applied all permissions are set to false (default) and query never returns any matches. This fixes it by always assigning Pull/Push/Admin to true when flatPermissions is enabled.
This commit is contained in:
parent
ee969979c6
commit
c60c59bd65
1 changed files with 3 additions and 5 deletions
|
@ -78,11 +78,9 @@ func (s *Syncer) Sync(ctx context.Context, user *model.User, flatPermissions boo
|
||||||
|
|
||||||
// TODO(485) temporary workaround to not hit api rate limits
|
// TODO(485) temporary workaround to not hit api rate limits
|
||||||
if flatPermissions {
|
if flatPermissions {
|
||||||
if repo.Perm == nil {
|
|
||||||
repo.Perm.Pull = true
|
repo.Perm.Pull = true
|
||||||
repo.Perm.Push = true
|
repo.Perm.Push = true
|
||||||
repo.Perm.Admin = true
|
repo.Perm.Admin = true
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
forgePerm, err := s.Forge.Perm(ctx, user, repo)
|
forgePerm, err := s.Forge.Perm(ctx, user, repo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue