Merge pull request #3286 from LinuxSuRen/fix-pip-input-approve-check

Fix the incorrect approvable check of Pipeline input
This commit is contained in:
KubeSphere CI Bot
2021-02-18 10:41:26 +08:00
committed by GitHub
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"
)