Files
forge/modules/structs/org.go
zeekayandHanzo Dev 9a07b4d089 legal: Hanzo AI, Inc. copyright above the upstream notices
2978 files. The fork is 2026-07-15 (rebrand: gitea.dev -> github.com/hanzoai/git),
so 2026 is the year, and "Copyright 2026 Hanzo AI, Inc." was already the form
used by the handful of files that had ours.

Shape is now:

	// Copyright 2026 Hanzo AI, Inc. All rights reserved.
	// Copyright 2015 The Gogs Authors. All rights reserved.
	// Copyright 2019 The Gitea Authors. All rights reserved.
	// SPDX-License-Identifier: MIT

Ours on top, theirs retained verbatim. Retained because MIT requires it, and
separately because they are true — those authors did write that code.

Not renamed to "The Git Authors": Git is a different project under a different
license, and putting its name here would attribute this code to people who have
nothing to do with it. Adding our line is the fix; overwriting theirs would have
been both a licence violation and a false statement.

gofmt still reports import-order drift in some of these files. It predates this
change (verified against a stash) and is left alone rather than burying a
one-line-per-file legal change under 3000 files of unrelated reordering.

Build clean.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-27 13:49:52 -07:00

95 lines
3.8 KiB
Go

// Copyright 2026 Hanzo AI, Inc. All rights reserved.
// Copyright 2015 The Gogs Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package structs
// Organization represents an organization
type Organization struct {
// The unique identifier of the organization
ID int64 `json:"id"`
// The name of the organization
Name string `json:"name"`
// The full display name of the organization
FullName string `json:"full_name"`
// The email address of the organization
Email string `json:"email"`
// The URL of the organization's avatar
AvatarURL string `json:"avatar_url"`
// The description of the organization
Description string `json:"description"`
// The website URL of the organization
Website string `json:"website"`
// The location of the organization
Location string `json:"location"`
// The visibility level of the organization (public, limited, private)
Visibility UserVisibility `json:"visibility"`
// Whether repository administrators can change team access
RepoAdminChangeTeamAccess bool `json:"repo_admin_change_team_access"`
// username of the organization
// deprecated
UserName string `json:"username"`
}
// OrganizationPermissions list different users permissions on an organization
type OrganizationPermissions struct {
// Whether the user is an owner of the organization
IsOwner bool `json:"is_owner"`
// Whether the user is an admin of the organization
IsAdmin bool `json:"is_admin"`
// Whether the user can write to the organization
CanWrite bool `json:"can_write"`
// Whether the user can read the organization
CanRead bool `json:"can_read"`
// Whether the user can create repositories in the organization
CanCreateRepository bool `json:"can_create_repository"`
}
// CreateOrgOption options for creating an organization
type CreateOrgOption struct {
// username of the organization
// required: true
UserName string `json:"username" binding:"Required;Username;MaxSize(40)"`
// The full display name of the organization
FullName string `json:"full_name" binding:"MaxSize(100)"`
// The email address of the organization
Email string `json:"email" binding:"MaxSize(255)"`
// The description of the organization
Description string `json:"description" binding:"MaxSize(255)"`
// The website URL of the organization
Website string `json:"website" binding:"ValidUrl;MaxSize(255)"`
// The location of the organization
Location string `json:"location" binding:"MaxSize(50)"`
// possible values are `public` (default), `limited` or `private`
Visibility UserVisibility `json:"visibility" binding:"In(,public,limited,private)"`
// Whether repository administrators can change team access
RepoAdminChangeTeamAccess bool `json:"repo_admin_change_team_access"`
}
// EditOrgOption options for editing an organization
type EditOrgOption struct {
// The full display name of the organization
FullName *string `json:"full_name" binding:"MaxSize(100)"`
// The email address of the organization; use empty string to clear
Email *string `json:"email" binding:"MaxSize(255)"`
// The description of the organization
Description *string `json:"description" binding:"MaxSize(255)"`
// The website URL of the organization
Website *string `json:"website" binding:"ValidUrl;MaxSize(255)"`
// The location of the organization
Location *string `json:"location" binding:"MaxSize(50)"`
// possible values are `public`, `limited` or `private`
Visibility *UserVisibility `json:"visibility" binding:"In(,public,limited,private)"`
// Whether repository administrators can change team access
RepoAdminChangeTeamAccess *bool `json:"repo_admin_change_team_access"`
}
// RenameOrgOption options when renaming an organization
type RenameOrgOption struct {
// New username for this org. This name cannot be in use yet by any other user.
//
// required: true
// unique: true
NewName string `json:"new_name" binding:"Required"`
}