From 816a30397da6ceff836d8723233dc5cdbda70871 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 21 Nov 2017 13:08:32 -0600 Subject: Role refactor (#7867) * role refactor * add missing file * fix web test --- app/role.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 app/role.go (limited to 'app/role.go') diff --git a/app/role.go b/app/role.go new file mode 100644 index 000000000..5f39dd623 --- /dev/null +++ b/app/role.go @@ -0,0 +1,19 @@ +// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +package app + +import ( + "github.com/mattermost/mattermost-server/model" + "github.com/mattermost/mattermost-server/utils" +) + +func (a *App) Role(id string) *model.Role { + return a.roles[id] +} + +// Updates the roles based on the app config and the global license check. You may need to invoke +// this when license changes are made. +func (a *App) SetDefaultRolesBasedOnConfig() { + a.roles = utils.DefaultRolesBasedOnConfig(a.Config()) +} -- cgit v1.2.3-1-g7c22