Skip to content

Commit ad9544a

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: [skip ci] Updated translations via Crowdin Add spectral linter for Swagger (go-gitea#20321) Store read access in access for team repo's (go-gitea#20275)
2 parents b2d7cf0 + 734e81d commit ad9544a

File tree

9 files changed

+10357
-7545
lines changed

9 files changed

+10357
-7545
lines changed

.spectral.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
extends: [[spectral:oas, all]]
2+
3+
rules:
4+
info-contact: off
5+
oas2-api-host: off
6+
oas2-parameter-description: off
7+
oas2-schema: off
8+
oas2-valid-schema-example: off
9+
openapi-tags: off
10+
operation-description: off
11+
operation-singular-tag: off
12+
operation-tag-defined: off

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ lint: lint-frontend lint-backend
312312
lint-frontend: node_modules
313313
npx eslint --color --max-warnings=0 web_src/js build templates *.config.js docs/assets/js
314314
npx stylelint --color --max-warnings=0 web_src/less
315+
npx spectral lint -q -F hint $(SWAGGER_SPEC)
315316

316317
.PHONY: lint-backend
317318
lint-backend: golangci-lint vet editorconfig-checker

models/perm/access/access.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,13 @@ func updateUserAccess(accessMap map[int64]*userAccess, user *user_model.User, mo
8686
// FIXME: do cross-comparison so reduce deletions and additions to the minimum?
8787
func refreshAccesses(ctx context.Context, repo *repo_model.Repository, accessMap map[int64]*userAccess) (err error) {
8888
minMode := perm.AccessModeRead
89-
if !repo.IsPrivate {
89+
if err := repo.GetOwner(ctx); err != nil {
90+
return fmt.Errorf("GetOwner: %v", err)
91+
}
92+
93+
// If the repo isn't private and isn't owned by a organization,
94+
// increase the minMode to Write.
95+
if !repo.IsPrivate && !repo.Owner.IsOrganization() {
9096
minMode = perm.AccessModeWrite
9197
}
9298

options/locale/locale_zh-CN.ini

+3
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,9 @@ default_branch=默认分支
861861
default_branch_helper=默认分支是用于合并请求和代码提交的基础分支。
862862
mirror_prune=修剪
863863
mirror_prune_desc=删除过时的远程跟踪引用
864+
mirror_interval=镜像间隔 (有效的时间单位是 'h', 'm', 's')。0 禁用自动定期同步 (最短间隔: %s)
864865
mirror_interval_invalid=镜像间隔无效。
866+
mirror_sync_on_commit=推送提交时同步
865867
mirror_address=从URL克隆
866868
mirror_address_desc=在授权框中输入必要的凭据。
867869
mirror_address_url_invalid=URL无效。请检查您所输入的URL是否正确。
@@ -1301,6 +1303,7 @@ issues.previous=上一页
13011303
issues.next=下一页
13021304
issues.open_title=开启中
13031305
issues.closed_title=已关闭
1306+
issues.draft_title=草稿
13041307
issues.num_comments=%d 条评论
13051308
issues.commented_at=`评论于 <a href="#%s">%s</a>`
13061309
issues.delete_comment_confirm=您确定要删除该条评论吗?

0 commit comments

Comments
 (0)