summaryrefslogtreecommitdiffstats
path: root/app/compliance.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2018-02-06 17:25:49 -0600
committerGitHub <noreply@github.com>2018-02-06 17:25:49 -0600
commit1ec295f88ca99e9423ffd91019cecf802ae3dc77 (patch)
tree05abc364fefdc6b1088bfb4a307ba11db0dc427f /app/compliance.go
parent034dbc07e3068c482e654b6a1a8fcbe4b01c44f3 (diff)
downloadchat-1ec295f88ca99e9423ffd91019cecf802ae3dc77.tar.gz
chat-1ec295f88ca99e9423ffd91019cecf802ae3dc77.tar.bz2
chat-1ec295f88ca99e9423ffd91019cecf802ae3dc77.zip
add App.License, remove utils.IsLicensed / utils.License calls (#8203)
Diffstat (limited to 'app/compliance.go')
-rw-r--r--app/compliance.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/compliance.go b/app/compliance.go
index 2a1b86a6b..5c62a49d9 100644
--- a/app/compliance.go
+++ b/app/compliance.go
@@ -9,11 +9,10 @@ import (
"net/http"
"github.com/mattermost/mattermost-server/model"
- "github.com/mattermost/mattermost-server/utils"
)
func (a *App) GetComplianceReports(page, perPage int) (model.Compliances, *model.AppError) {
- if !*a.Config().ComplianceSettings.Enable || !utils.IsLicensed() || !*utils.License().Features.Compliance {
+ if license := a.License(); !*a.Config().ComplianceSettings.Enable || license == nil || !*license.Features.Compliance {
return nil, model.NewAppError("GetComplianceReports", "ent.compliance.licence_disable.app_error", nil, "", http.StatusNotImplemented)
}
@@ -25,7 +24,7 @@ func (a *App) GetComplianceReports(page, perPage int) (model.Compliances, *model
}
func (a *App) SaveComplianceReport(job *model.Compliance) (*model.Compliance, *model.AppError) {
- if !*a.Config().ComplianceSettings.Enable || !utils.IsLicensed() || !*utils.License().Features.Compliance || a.Compliance == nil {
+ if license := a.License(); !*a.Config().ComplianceSettings.Enable || license == nil || !*license.Features.Compliance || a.Compliance == nil {
return nil, model.NewAppError("saveComplianceReport", "ent.compliance.licence_disable.app_error", nil, "", http.StatusNotImplemented)
}
@@ -44,7 +43,7 @@ func (a *App) SaveComplianceReport(job *model.Compliance) (*model.Compliance, *m
}
func (a *App) GetComplianceReport(reportId string) (*model.Compliance, *model.AppError) {
- if !*a.Config().ComplianceSettings.Enable || !utils.IsLicensed() || !*utils.License().Features.Compliance || a.Compliance == nil {
+ if license := a.License(); !*a.Config().ComplianceSettings.Enable || license == nil || !*license.Features.Compliance || a.Compliance == nil {
return nil, model.NewAppError("downloadComplianceReport", "ent.compliance.licence_disable.app_error", nil, "", http.StatusNotImplemented)
}