mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-24 01:24:39 +02:00
WIP
This commit is contained in:
1 parent
9a69f65ee4
commit
43e96d5ead
9 files changed
+230
-1
No files matched your search
@@ -280,6 +280,19 @@ func GetActionsUserRepoPermission(ctx context.Context, repo *repo_model.Reposito
|
||||
if err != nil || !exist {
|
||||
return perm, err
|
||||
}
|
||||
|
||||
// Check Organization Cross-Repo Access Policy
|
||||
if repo.OwnerID == taskRepo.OwnerID && repo.Owner.IsOrganization() {
|
||||
orgCfg, err := actions_model.GetOrgActionsConfig(ctx, repo.OwnerID)
|
||||
if err != nil {
|
||||
return perm, err
|
||||
}
|
||||
if !orgCfg.AllowCrossRepoAccess {
|
||||
// Deny access if cross-repo is disabled in Org
|
||||
return perm, nil
|
||||
}
|
||||
}
|
||||
|
||||
if !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.
|
||||
|
||||
Reference in new issue
Block a user