Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EE license check #151

Merged
merged 9 commits into from
Jun 15, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/gorilla/mux v1.7.3
github.com/jarcoal/httpmock v1.0.4
github.com/mattermost/mattermost-plugin-api v0.0.9
github.com/mattermost/mattermost-server/v5 v5.3.2-0.20200313113657-e2883bfe5f37
github.com/mattermost/mattermost-server/v5 v5.24.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could some commit on master be used instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was discussed on a different conversation. We will point to master, merge this, and whenever 5.24 is addressable, we will update the plugin to address the correct server version.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github.com/pkg/errors v0.9.1
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.5.1
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Microsoft Calendar",
"description": "Microsoft Calendar Integration",
"version": "0.1.0",
"min_server_version": "5.16.0",
"min_server_version": "5.24.0",
"server": {
"executables": {
"linux-amd64": "server/dist/plugin-linux-amd64",
Expand Down
5 changes: 5 additions & 0 deletions server/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ func NewWithEnv(env mscalendar.Env) *Plugin {
}

func (p *Plugin) OnActivate() error {
license := p.API.GetLicense()
if license == nil || !license.Features.EnterprisePlugins {
return errors.New("You need a Enterprise License to activate this plugin.")
}

p.initEnv(&p.env, "")
bundlePath, err := p.API.GetBundlePath()
if err != nil {
Expand Down