Seeder: Add missing methods to Registrations (#81961)

* add slice copy method

* fix slice copy
This commit is contained in:
Jo 2024-02-08 09:54:17 +01:00 committed by GitHub
parent 117a4b4b0a
commit 6ac0bc5ecf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -381,6 +381,14 @@ func (m *RegistrationList) Range(f func(registration RoleRegistration) bool) {
}
}
func (m *RegistrationList) Slice() []RoleRegistration {
m.mx.RLock()
defer m.mx.RUnlock()
out := make([]RoleRegistration, len(m.registrations))
copy(out, m.registrations)
return out
}
func BuildBasicRoleDefinitions() map[string]*RoleDTO {
return map[string]*RoleDTO{
string(org.RoleAdmin): {