snapshot of https://github.com/go-gitea/gitea.git (main, 2026-09-15; blobs > 131072B omitted)
Some checks failed
cache-seeder / prune (push) Has been skipped
cache-seeder / frontend (push) Failing after 3s
cache-seeder / python (push) Failing after 3s
cache-seeder / gobuild (push) Failing after 4s
cache-seeder / lint (bindata, lint-backend) (push) Failing after 3s
giteabot backport / giteabot (push) Has been skipped
giteabot / giteabot (push) Has been skipped
cache-prune / prune (push) Has been skipped
release-nightly-snapcraft / build-and-publish (ubuntu-24.04) (push) Has been cancelled
release-nightly-snapcraft / build-and-publish (ubuntu-24.04-arm) (push) Has been cancelled
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
cron-renovate / cron-renovate (push) Has been skipped
Some checks failed
cache-seeder / prune (push) Has been skipped
cache-seeder / frontend (push) Failing after 3s
cache-seeder / python (push) Failing after 3s
cache-seeder / gobuild (push) Failing after 4s
cache-seeder / lint (bindata, lint-backend) (push) Failing after 3s
giteabot backport / giteabot (push) Has been skipped
giteabot / giteabot (push) Has been skipped
cache-prune / prune (push) Has been skipped
release-nightly-snapcraft / build-and-publish (ubuntu-24.04) (push) Has been cancelled
release-nightly-snapcraft / build-and-publish (ubuntu-24.04-arm) (push) Has been cancelled
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
cron-renovate / cron-renovate (push) Has been skipped
This commit is contained in:
45
modules/structs/repo_collaborator.go
Normal file
45
modules/structs/repo_collaborator.go
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright 2016 The Gogs Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package structs
|
||||
|
||||
// RepoWritePermission is a permission level callers may grant to a team or
|
||||
// collaborator on input. Output fields use AccessLevelName instead.
|
||||
// swagger:enum RepoWritePermission
|
||||
type RepoWritePermission string
|
||||
|
||||
const (
|
||||
RepoWritePermissionRead RepoWritePermission = "read"
|
||||
RepoWritePermissionWrite RepoWritePermission = "write"
|
||||
RepoWritePermissionAdmin RepoWritePermission = "admin"
|
||||
)
|
||||
|
||||
// AccessLevelName is the string rendering of a perm.AccessMode produced on
|
||||
// API responses. Callers must not send these values; use RepoWritePermission
|
||||
// on input.
|
||||
// swagger:enum AccessLevelName
|
||||
type AccessLevelName string
|
||||
|
||||
const (
|
||||
AccessLevelNameNone AccessLevelName = "none"
|
||||
AccessLevelNameRead AccessLevelName = "read"
|
||||
AccessLevelNameWrite AccessLevelName = "write"
|
||||
AccessLevelNameAdmin AccessLevelName = "admin"
|
||||
AccessLevelNameOwner AccessLevelName = "owner"
|
||||
)
|
||||
|
||||
// AddCollaboratorOption options when adding a user as a collaborator of a repository
|
||||
type AddCollaboratorOption struct {
|
||||
// Permission level to grant the collaborator
|
||||
Permission *RepoWritePermission `json:"permission"`
|
||||
}
|
||||
|
||||
// RepoCollaboratorPermission to get repository permission for a collaborator
|
||||
type RepoCollaboratorPermission struct {
|
||||
// Permission level of the collaborator
|
||||
Permission AccessLevelName `json:"permission"`
|
||||
// RoleName is the name of the permission role
|
||||
RoleName string `json:"role_name"`
|
||||
// User information of the collaborator
|
||||
User *User `json:"user"`
|
||||
}
|
||||
Reference in New Issue
Block a user