mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 07:19:41 +02:00
* feat(settings): add setting to disable device mapping for regular users * feat(settings): introduce device mapping service * feat(containers): hide devices field when setting is on * feat(containers): prevent passing of devices when not allowed * feat(stacks): prevent non admin from device mapping * feat(stacks): disallow swarm stack creation for user * refactor(settings): replace disableDeviceMapping with allow * fix(stacks): remove check for disable device mappings from swarm * feat(settings): rename field to disable * feat(settings): supply default value for disableDeviceMapping * feat(container): check for endpoint admin * style(server): sort imports
13 lines
329 B
Go
13 lines
329 B
Go
package migrator
|
|
|
|
func (m *Migrator) updateSettingsToDB24() error {
|
|
legacySettings, err := m.settingsService.Settings()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
legacySettings.AllowHostNamespaceForRegularUsers = true
|
|
legacySettings.AllowDeviceMappingForRegularUsers = true
|
|
|
|
return m.settingsService.UpdateSettings(legacySettings)
|
|
}
|