diff --git a/pkg/models/label.go b/pkg/models/label.go index 3725811bb..b39e6ae83 100644 --- a/pkg/models/label.go +++ b/pkg/models/label.go @@ -29,7 +29,7 @@ import ( // Label represents a label type Label struct { // The unique, numeric id of this label. - ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"label" doc:"The unique, numeric id of this label."` + ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"label" readOnly:"true" doc:"The unique, numeric id of this label."` // The title of the label. You'll see this one on tasks associated with it. Title string `xorm:"varchar(250) not null" json:"title" valid:"runelength(1|250)" minLength:"1" maxLength:"250" doc:"The title of the label. You'll see this one on tasks associated with it."` // The label description. @@ -39,12 +39,12 @@ type Label struct { CreatedByID int64 `xorm:"bigint not null" json:"-"` // The user who created this label - CreatedBy *user.User `xorm:"-" json:"created_by" doc:"The user who created this label."` + CreatedBy *user.User `xorm:"-" json:"created_by" readOnly:"true" doc:"The user who created this label."` // A timestamp when this label was created. You cannot change this value. - Created time.Time `xorm:"created not null" json:"created" doc:"A timestamp when this label was created. You cannot change this value."` + Created time.Time `xorm:"created not null" json:"created" readOnly:"true" doc:"A timestamp when this label was created. You cannot change this value."` // A timestamp when this label was last updated. You cannot change this value. - Updated time.Time `xorm:"updated not null" json:"updated" doc:"A timestamp when this label was last updated. You cannot change this value."` + Updated time.Time `xorm:"updated not null" json:"updated" readOnly:"true" doc:"A timestamp when this label was last updated. You cannot change this value."` web.CRUDable `xorm:"-" json:"-"` web.Permissions `xorm:"-" json:"-"` diff --git a/pkg/user/user.go b/pkg/user/user.go index eaf8b18b4..4464858e7 100644 --- a/pkg/user/user.go +++ b/pkg/user/user.go @@ -84,7 +84,7 @@ const ( // User holds information about an user type User struct { // The unique, numeric id of this user. - ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"bot"` + ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"bot" readOnly:"true"` // The full name of the user. Name string `xorm:"text null" json:"name"` // The username of the user. Is always unique. @@ -112,7 +112,7 @@ type User struct { DefaultProjectID int64 `xorm:"bigint null index" json:"-"` // BotOwnerID is the ID of the owning (human) user if this user is a bot. // A non-zero value means this user is a bot and cannot authenticate via password. - BotOwnerID int64 `xorm:"bigint null index" json:"bot_owner_id,omitempty"` + BotOwnerID int64 `xorm:"bigint null index" json:"bot_owner_id,omitempty" readOnly:"true"` WeekStart int `xorm:"null" json:"-"` Language string `xorm:"varchar(50) null" json:"-" valid:"language"` Timezone string `xorm:"varchar(255) null" json:"-"` @@ -126,9 +126,9 @@ type User struct { ExportFileID int64 `xorm:"bigint null" json:"-"` // A timestamp when this task 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"` // A timestamp when this task 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"` web.Auth `xorm:"-" json:"-"` }