2019-09-09 22:58:26 +00:00
|
|
|
package migrator
|
|
|
|
|
|
|
|
import portainer "github.com/portainer/portainer/api"
|
|
|
|
|
|
|
|
func (m *Migrator) updateUsersToDBVersion20() error {
|
|
|
|
authorizationServiceParameters := &portainer.AuthorizationServiceParameters{
|
|
|
|
EndpointService: m.endpointService,
|
|
|
|
EndpointGroupService: m.endpointGroupService,
|
2019-10-07 02:42:01 +00:00
|
|
|
RegistryService: m.registryService,
|
2019-09-09 22:58:26 +00:00
|
|
|
RoleService: m.roleService,
|
|
|
|
TeamMembershipService: m.teamMembershipService,
|
|
|
|
UserService: m.userService,
|
|
|
|
}
|
|
|
|
|
|
|
|
authorizationService := portainer.NewAuthorizationService(authorizationServiceParameters)
|
2019-10-07 02:42:01 +00:00
|
|
|
return authorizationService.UpdateUsersAuthorizations()
|
2019-09-09 22:58:26 +00:00
|
|
|
}
|
2019-10-08 00:17:58 +00:00
|
|
|
|
|
|
|
func (m *Migrator) updateSettingsToDBVersion20() error {
|
|
|
|
legacySettings, err := m.settingsService.Settings()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
legacySettings.AllowVolumeBrowserForRegularUsers = false
|
|
|
|
|
|
|
|
return m.settingsService.UpdateSettings(legacySettings)
|
|
|
|
}
|