Fix the incorrect approvable check of Pipeline input

Signed-off-by: rick <rick@jenkins-zh.cn>
This commit is contained in:
rick
2021-01-20 10:32:50 +08:00
parent 1f4d5cb686
commit 530c6911a5
8 changed files with 114 additions and 58 deletions

View File

@@ -133,7 +133,7 @@ func (a AttributesRecord) GetVerb() string {
}
func (a AttributesRecord) IsReadOnly() bool {
return a.Verb == "get" || a.Verb == "list" || a.Verb == "watch"
return a.Verb == VerbGet || a.Verb == VerbList || a.Verb == VerbWatch
}
func (a AttributesRecord) GetCluster() string {
@@ -199,3 +199,14 @@ const (
// to allow or deny an action.
DecisionNoOpinion
)
const (
// VerbList represents the verb of listing resources
VerbList = "list"
// VerbCreate represents the verb of creating a resource
VerbCreate = "create"
// VerbGet represents the verb of getting a resource or resources
VerbGet = "get"
// VerbWatch represents the verb of watching a resource
VerbWatch = "watch"
)