1
0
Fork 0
forked from External/ergo
Improve auditability of sensitive operator actions
This commit is contained in:
Shivaram Lingamneni 2021-01-15 09:26:34 -05:00
parent e195854851
commit 64bc363cf1
4 changed files with 40 additions and 13 deletions

View file

@ -733,6 +733,10 @@ type Oper struct {
Modes []modes.ModeChange
}
func (oper *Oper) HasRoleCapab(capab string) bool {
return oper != nil && oper.Class.Capabilities.Has(capab)
}
// Operators returns a map of operator configs from the given OperClass and config.
func (conf *Config) Operators(oc map[string]*OperClass) (map[string]*Oper, error) {
operators := make(map[string]*Oper)