Files
unibots/pkg/acl/config.go
T
agent fc644ecd6e feat: import agents_and_robots platform as unibots (Matrix-out, unibus transport)
Reemplaza el scaffold del echobot por la plataforma completa de bots traida
desde ~/DataProyects/Github/agents_and_robots tras la operacion Matrix-out:
los bots ya no hablan por Matrix sino por el bus unibus (modelo todo-rooms +
E2E via shell/transportunibus sobre github.com/enmanuel/unibus/pkg/client).

- go.mod: replace de unibus -> ../unibus y de fn-registry -> ../../../.. (paths
  relativos reajustados a la nueva ubicacion dentro de fn_registry).
- app.md: bump a 0.2.0, descripcion + arquitectura + comandos + gotchas reales.
- modulo Go conservado como github.com/enmanuel/agents (sin reescribir imports).

agents_and_robots queda archivado como museo de la era Matrix.
2026-06-07 11:50:13 +02:00

27 lines
616 B
Go

package acl
// RoleDef is the input shape for building an ACL — matches config.RoleCfg.
type RoleDef struct {
Users []string
Actions []string
}
// FromRoles builds an ACL directly from a slice of Role values.
func FromRoles(roles []Role) ACL {
return ACL{roles: roles}
}
// FromMap builds an ACL from a map of role name → RoleDef.
// This is the primary constructor used from the runtime.
func FromMap(roles map[string]RoleDef) ACL {
var rs []Role
for name, def := range roles {
rs = append(rs, Role{
Name: name,
Users: def.Users,
Actions: def.Actions,
})
}
return ACL{roles: rs}
}