Implemented admin pane + user permission
This commit is contained in:
+12
-4
@@ -24,12 +24,20 @@ type ConfigRule struct {
|
||||
Name string `json:"name"`
|
||||
SetID string `json:"setId"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Version int `json:"version"`
|
||||
Tag string `json:"tag,omitempty"`
|
||||
Owner string `json:"owner,omitempty"`
|
||||
Source string `json:"source"`
|
||||
// Enabled gates whether the rule runs when instances of the bound set are
|
||||
// saved/applied. A nil pointer (legacy rules created before the flag) is
|
||||
// treated as enabled, so existing rules keep their behaviour.
|
||||
Enabled *bool `json:"enabled,omitempty"`
|
||||
Version int `json:"version"`
|
||||
Tag string `json:"tag,omitempty"`
|
||||
Owner string `json:"owner,omitempty"`
|
||||
Source string `json:"source"`
|
||||
}
|
||||
|
||||
// IsEnabled reports whether the rule participates in instance evaluation. A nil
|
||||
// Enabled flag (legacy rules) is treated as enabled.
|
||||
func (r ConfigRule) IsEnabled() bool { return r.Enabled == nil || *r.Enabled }
|
||||
|
||||
// RuleViolation is a single constraint failure from evaluating a rule.
|
||||
type RuleViolation struct {
|
||||
Rule string `json:"rule,omitempty"` // rule ID that produced it (aggregate runs)
|
||||
|
||||
Reference in New Issue
Block a user