mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-02-20 01:28:45 +01:00
14 lines
363 B
Go
14 lines
363 B
Go
package security
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
// RBACName constructs name of the app for use in RBAC checks.
|
|
func RBACName(defaultNS string, project string, namespace string, name string) string {
|
|
if defaultNS != "" && namespace != defaultNS && namespace != "" {
|
|
return fmt.Sprintf("%s/%s/%s", project, namespace, name)
|
|
}
|
|
return fmt.Sprintf("%s/%s", project, name)
|
|
}
|