From d25de6fb86e3b3c126d8d6f54b96657ec540d396 Mon Sep 17 00:00:00 2001 From: Excellencedev Date: Sat, 20 Dec 2025 11:13:47 +0100 Subject: [PATCH] test fix --- models/perm/access/repo_permission.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/models/perm/access/repo_permission.go b/models/perm/access/repo_permission.go index c934a13d038..38515dd0d46 100644 --- a/models/perm/access/repo_permission.go +++ b/models/perm/access/repo_permission.go @@ -292,7 +292,10 @@ func GetActionsUserRepoPermission(ctx context.Context, repo *repo_model.Reposito if err := repo.LoadOwner(ctx); err != nil { return perm, err } + + isSameOrg := false if repo.OwnerID == taskRepo.OwnerID && repo.Owner.IsOrganization() { + isSameOrg = true orgCfg, err := actions_model.GetOrgActionsConfig(ctx, repo.OwnerID) if err != nil { return perm, err @@ -303,7 +306,7 @@ func GetActionsUserRepoPermission(ctx context.Context, repo *repo_model.Reposito } } - if !actionsCfg.IsCollaborativeOwner(taskRepo.OwnerID) || !taskRepo.IsPrivate { + if (!isSameOrg && !actionsCfg.IsCollaborativeOwner(taskRepo.OwnerID)) || !taskRepo.IsPrivate { // The task repo can access the current repo only if the task repo is private and // the owner of the task repo is a collaborative owner of the current repo. // FIXME should owner's visibility also be considered here?