Align SLURP access control with config authority levels

This commit is contained in:
anthonyrawlins
2025-09-27 15:33:23 +10:00
parent 0b670a535d
commit a99469f346
3 changed files with 157 additions and 148 deletions

View File

@@ -274,14 +274,13 @@ func (c *Config) ApplyRoleDefinition(role string) error {
}
// GetRoleAuthority returns the authority level for a role (from CHORUS)
func (c *Config) GetRoleAuthority(role string) (string, error) {
// This would contain the authority mapping from CHORUS
switch role {
case "admin":
return "master", nil
default:
return "member", nil
func (c *Config) GetRoleAuthority(role string) (AuthorityLevel, error) {
roles := GetPredefinedRoles()
if def, ok := roles[role]; ok {
return def.AuthorityLevel, nil
}
return AuthorityReadOnly, fmt.Errorf("unknown role: %s", role)
}
// Helper functions for environment variable parsing