Changed definition of storage.CollapseRolesIntoOne and RoleDeepCopy
No more list of pointers/pointer
This commit is contained in:
parent
fc0875e494
commit
92fd3d7f0b
1 changed files with 4 additions and 4 deletions
|
@ -92,9 +92,9 @@ func main() {
|
||||||
|
|
||||||
// Build role collapse function
|
// Build role collapse function
|
||||||
outBuilder.WriteString(
|
outBuilder.WriteString(
|
||||||
`func CollapseRolesIntoOne(roles ...*Role) Role {
|
`func CollapseRolesIntoOne(roles ...Role) Role {
|
||||||
startingRole := RoleDeepCopy(&DefaultUserRole)
|
startingRole := RoleDeepCopy(DefaultUserRole)
|
||||||
slices.SortFunc(roles, func(a, b *Role) int { return int(int64(a.Priority)-int64(b.Priority)) })
|
slices.SortFunc(roles, func(a, b Role) int { return int(int64(a.Priority)-int64(b.Priority)) })
|
||||||
for _, role := range roles {
|
for _, role := range roles {
|
||||||
`)
|
`)
|
||||||
// Write all the stupid conditions here
|
// Write all the stupid conditions here
|
||||||
|
@ -119,7 +119,7 @@ func main() {
|
||||||
`)
|
`)
|
||||||
|
|
||||||
// Then build the deep copy function
|
// Then build the deep copy function
|
||||||
outBuilder.WriteString("\nfunc RoleDeepCopy(o *Role) Role {\n")
|
outBuilder.WriteString("\nfunc RoleDeepCopy(o Role) Role {\n")
|
||||||
outBuilder.WriteString(` n := Role{}
|
outBuilder.WriteString(` n := Role{}
|
||||||
n.Model = o.Model
|
n.Model = o.Model
|
||||||
n.Name = o.Name
|
n.Name = o.Name
|
||||||
|
|
Loading…
Reference in a new issue