fixed bugs in community profile

This commit is contained in:
2025-10-18 16:45:43 -06:00
parent 83bd817630
commit 94c3877819
8 changed files with 80 additions and 25 deletions
+10
View File
@@ -208,6 +208,7 @@ func (r *CfgRole) LevelStr() string {
type RoleList interface {
Roles() []Role
Default() Role
FindForLevel(uint16) Role
}
func (r *CfgRoleList) Roles() []Role {
@@ -222,6 +223,15 @@ func (r *CfgRoleList) Default() Role {
return r.defptr
}
func (r *CfgRoleList) FindForLevel(level uint16) Role {
for _, rp := range r.roleptrs {
if rp.level == level {
return rp
}
}
return nil
}
/* AmRole returns a Role given a string ID.
* Parameters:
* id - ID of the role to look up.