0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-02-13 12:59:00 +01:00
This commit is contained in:
Excellencedev 2026-01-03 13:39:01 +01:00
parent 9faf677652
commit 13660f202d
2 changed files with 1 additions and 7 deletions

View File

@ -95,7 +95,7 @@ func (p *Permission) UnitAccessMode(unitType unit.Type) perm_model.AccessMode {
if m, ok := p.unitsMode[unitType]; ok {
return util.Iif(p.AccessMode >= perm_model.AccessModeAdmin, p.AccessMode, m)
}
// If the units map does not contain the access mode, return the default access mode if the unit exists
// if the units map does not contain the access mode, return the default access mode if the unit exists
unitDefaultAccessMode := p.AccessMode
unitDefaultAccessMode = max(unitDefaultAccessMode, p.anonymousAccessMode[unitType])
unitDefaultAccessMode = max(unitDefaultAccessMode, p.everyoneAccessMode[unitType])

View File

@ -712,7 +712,6 @@ jobs:
require.NoError(t, db.Insert(t.Context(), job))
// 3. Change Repo Settings to RESTRICTED
// We need to update the RepoUnit config
unitConfig := &repo_model.ActionsConfig{
TokenPermissionMode: repo_model.ActionsTokenPermissionModeRestricted,
}
@ -727,11 +726,6 @@ jobs:
require.NoError(t, repo_model.UpdateRepoUnit(t.Context(), unit))
// 4. Trigger Rerun via Web Handler
// POST /:username/:reponame/actions/runs/:index/rerun
// We need to know operation run index. Since it's the first run, it should be 1?
// ActionRun.Index is auto-increment but not set in my insert.
// Ideally we use CreateRun which handles index.
// Let's manually set index 1.
run.Index = 1
_, err = db.GetEngine(t.Context()).ID(run.ID).Cols("index").Update(run)
require.NoError(t, err)