# helm_charts_user-roles.yaml
{{ if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: kubedb:core:admin
  labels:
    rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
- apiGroups:
  - kubedb.com
  resources:
  - dormantdatabases
  - elasticsearches
  - memcacheds
  - mongodbs
  - mysqls
  - postgreses
  - redises
  - snapshots
  verbs:
  - create
  - delete
  - deletecollection
  - get
  - list
  - patch
  - update
  - watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: kubedb:core:edit
  labels:
    rbac.authorization.k8s.io/aggregate-to-edit: "true"
rules:
- apiGroups:
  - kubedb.com
  resources:
  - elasticsearches
  - memcacheds
  - mongodbs
  - mysqls
  - postgreses
  - redises
  - snapshots
  verbs:
  - create
  - delete
  - deletecollection
  - get
  - list
  - patch
  - update
  - watch
- apiGroups:
  - kubedb.com
  resources:
  - dormantdatabases
  verbs:
  - get
  - list
  - watch
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: kubedb:core:view
  labels:
    rbac.authorization.k8s.io/aggregate-to-view: "true"
rules:
- apiGroups:
  - kubedb.com
  resources:
  - dormantdatabases
  - elasticsearches
  - memcacheds
  - mongodbs
  - mysqls
  - postgreses
  - redises
  - snapshots
  verbs:
  - get
  - list
  - watch
{{ end }}