Skip to content

Commit

Permalink
Merge remote-tracking branch 'giteaofficial/main'
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
zjjhot committed Jul 12, 2022
2 parents b2d7cf0 + 734e81d commit ad9544a
Show file tree
Hide file tree
Showing 9 changed files with 10,357 additions and 7,545 deletions.
12 changes: 12 additions & 0 deletions .spectral.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
extends: [[spectral:oas, all]]

rules:
info-contact: off
oas2-api-host: off
oas2-parameter-description: off
oas2-schema: off
oas2-valid-schema-example: off
openapi-tags: off
operation-description: off
operation-singular-tag: off
operation-tag-defined: off
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ lint: lint-frontend lint-backend
lint-frontend: node_modules
npx eslint --color --max-warnings=0 web_src/js build templates *.config.js docs/assets/js
npx stylelint --color --max-warnings=0 web_src/less
npx spectral lint -q -F hint $(SWAGGER_SPEC)

.PHONY: lint-backend
lint-backend: golangci-lint vet editorconfig-checker
Expand Down
8 changes: 7 additions & 1 deletion models/perm/access/access.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,13 @@ func updateUserAccess(accessMap map[int64]*userAccess, user *user_model.User, mo
// FIXME: do cross-comparison so reduce deletions and additions to the minimum?
func refreshAccesses(ctx context.Context, repo *repo_model.Repository, accessMap map[int64]*userAccess) (err error) {
minMode := perm.AccessModeRead
if !repo.IsPrivate {
if err := repo.GetOwner(ctx); err != nil {
return fmt.Errorf("GetOwner: %v", err)
}

// If the repo isn't private and isn't owned by a organization,
// increase the minMode to Write.
if !repo.IsPrivate && !repo.Owner.IsOrganization() {
minMode = perm.AccessModeWrite
}

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

0 comments on commit ad9544a

Please sign in to comment.