From 2c0608e47bdea75349b635efa5ce81459009258d Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 7 Jun 2026 12:12:37 +0200 Subject: [PATCH] docs(api/v2): tag project user share fields for the v2 schema --- pkg/models/project_users.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/models/project_users.go b/pkg/models/project_users.go index e57dcd6e9..58ef71c38 100644 --- a/pkg/models/project_users.go +++ b/pkg/models/project_users.go @@ -30,20 +30,20 @@ import ( // ProjectUser represents a project <-> user relation type ProjectUser struct { // The unique, numeric id of this project <-> user relation. - ID int64 `xorm:"bigint autoincr not null unique pk" json:"id"` + ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" readOnly:"true" doc:"The unique, numeric id of this project <-> user relation."` // The username. - Username string `xorm:"-" json:"username" param:"user"` + Username string `xorm:"-" json:"username" param:"user" doc:"The username of the user to share with. On update and delete this comes from the URL path, not the body."` // Used internally to reference the user UserID int64 `xorm:"bigint not null INDEX" json:"-"` // The project id. ProjectID int64 `xorm:"bigint not null INDEX" json:"-" param:"project"` // The permission this user has. 0 = Read only, 1 = Read & Write, 2 = Admin. See the docs for more details. - Permission Permission `xorm:"bigint INDEX not null default 0" json:"permission" valid:"length(0|2)" maximum:"2" default:"0"` + Permission Permission `xorm:"bigint INDEX not null default 0" json:"permission" valid:"length(0|2)" maximum:"2" default:"0" doc:"The permission this user has on the project. 0 = Read only, 1 = Read & Write, 2 = Admin."` // A timestamp when this relation was created. You cannot change this value. - Created time.Time `xorm:"created not null" json:"created"` + Created time.Time `xorm:"created not null" json:"created" readOnly:"true" doc:"A timestamp when this relation was created. You cannot change this value."` // A timestamp when this relation was last updated. You cannot change this value. - Updated time.Time `xorm:"updated not null" json:"updated"` + Updated time.Time `xorm:"updated not null" json:"updated" readOnly:"true" doc:"A timestamp when this relation was last updated. You cannot change this value."` web.CRUDable `xorm:"-" json:"-"` web.Permissions `xorm:"-" json:"-"` @@ -57,7 +57,7 @@ func (*ProjectUser) TableName() string { // UserWithPermission represents a user in combination with the permission it can have on a project type UserWithPermission struct { user.User `xorm:"extends"` - Permission Permission `json:"permission"` + Permission Permission `json:"permission" readOnly:"true" doc:"The permission this user has on the project. 0 = Read only, 1 = Read & Write, 2 = Admin."` } // Create creates a new project <-> user relation