mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
* #960 feat(UAC): change ownership to admins for externally created ressources * feat(UAC): change ownership to admins for externally created resources Deprecated AdministratorsOnly js and go backend * #960 feat(UAC): remove AdministratorsOnly property and minor GUI fixes Update swagger definition changing AdministratorsOnly to Public * #960 feat(UAC): fix create resource with access control data * #960 feat(UAC): authorization of non-admin users for restricted operations On stacks, containers networks, services , tasks and volumes. * #960 feat(UAC): database migration to version 14 The administrator resources are deleted and Public resources are now managed by admins * #960 feat(UAC): small fixes from PR #2137 * #960 feat(UAC): improve the readability of the source code * feat(UAC) fix displayed ownership for Swarm related resources (#960)
19 lines
426 B
Go
19 lines
426 B
Go
package migrator
|
|
|
|
func (m *Migrator) updateResourceControlsToDBVersion14() error {
|
|
resourceControls, err := m.resourceControlService.ResourceControls()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
for _, resourceControl := range resourceControls {
|
|
if resourceControl.AdministratorsOnly == true {
|
|
err = m.resourceControlService.DeleteResourceControl(resourceControl.ID)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|