|
|
@@ -65,6 +65,15 @@ func (ctx *Context) IsUserRepoAdmin() bool { |
|
|
|
return ctx.Repo.IsAdmin() |
|
|
|
} |
|
|
|
|
|
|
|
func (ctx *Context) IsCourse() bool { |
|
|
|
if ctx.Org != nil && ctx.Org.Organization != nil { |
|
|
|
if ctx.Org.Organization.Name == setting.Course.OrgName { |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
return false |
|
|
|
} |
|
|
|
|
|
|
|
// IsUserRepoWriter returns true if current user has write privilege in current repo |
|
|
|
func (ctx *Context) IsUserRepoWriter(unitTypes []models.UnitType) bool { |
|
|
|
for _, unitType := range unitTypes { |
|
|
|