docs(api/v2): tag project user share fields for the v2 schema
This commit is contained in:
parent
7158334699
commit
2c0608e47b
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue