Merge remote-tracking branch 'origin/release-4.9' into merge49final

Этот коммит содержится в:
Derrick Anderson
2018-04-17 09:21:33 -04:00
родитель 997df03ac1 3176e13b1f
Коммит 885b8e51f3
5 изменённых файлов: 15 добавлений и 80 удалений

Просмотреть файл

@@ -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()

Просмотреть файл

@@ -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