diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/app.go | 7 | ||||
-rw-r--r-- | app/authorization.go | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/app/app.go b/app/app.go index 43f598f79..51ee37cbd 100644 --- a/app/app.go +++ b/app/app.go @@ -126,7 +126,14 @@ func New(options ...Option) (outApp *App, outErr error) { } } model.AppErrorInit(utils.T) + + // The first time we load config, clear any existing filters to allow the configuration + // changes to take effect. This is safe only because no one else is logging at this point. + l4g.Close() + if err := app.LoadConfig(app.configFile); err != nil { + // Re-initialize the default logger as we bail out. + l4g.Global = l4g.NewDefaultLogger(l4g.DEBUG) return nil, err } app.EnableConfigWatch() diff --git a/app/authorization.go b/app/authorization.go index 632dd7566..2187472f7 100644 --- a/app/authorization.go +++ b/app/authorization.go @@ -12,12 +12,7 @@ import ( ) func (a *App) SessionHasPermissionTo(session model.Session, permission *model.Permission) bool { - if !a.RolesGrantPermission(session.GetUserRoles(), permission.Id) { - a.ClearSessionCacheForUser(session.UserId) - return false - } - - return true + return a.RolesGrantPermission(session.GetUserRoles(), permission.Id) } /// DO NOT USE: LEGACY |