Sfoglia il codice sorgente

Started Implementing IsIntern Option

Yoginth 7 anni fa
parent
commit
8a6945f04f
3 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 1 0
      models/user.go
  2. 1 0
      pkg/context/context.go
  3. 1 0
      pkg/form/admin.go

+ 1 - 0
models/user.go

@@ -77,6 +77,7 @@ type User struct {
 	IsBeta           bool
 	ShowSponsors     bool
 	IsStaff          bool
+	IsIntern         bool
 	IsAdmin          bool
 	AllowGitHook     bool
 	AllowImportLocal bool // Allow migrate repository by local path

+ 1 - 0
pkg/context/context.go

@@ -316,6 +316,7 @@ func Contexter() macaron.Handler {
 			c.Data["LoggedUserName"] = c.User.Name
 			c.Data["IsAdmin"] = c.User.IsAdmin
 			c.Data["IsStaff"] = c.User.IsStaff
+			c.Data["IsIntern"] = c.User.IsIntern
 			c.Data["IsBeta"] = c.User.IsBeta
 		} else {
 			c.Data["LoggedUserID"] = 0

+ 1 - 0
pkg/form/admin.go

@@ -49,6 +49,7 @@ type AdminEditUser struct {
 	IsBugHunter      bool
 	IsBeta           bool
 	IsStaff          bool
+	IsIntern         bool
 }
 
 func (f *AdminEditUser) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {