# Copyright 2019 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: knative-eventing-namespaced-admin
  labels:
    eventing.knative.dev/release: devel
    rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
  - apiGroups: ["eventing.knative.dev"]
    resources: ["*"]
    verbs: ["*"]
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: knative-messaging-namespaced-admin
  labels:
    eventing.knative.dev/release: devel
    rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
  - apiGroups: ["messaging.knative.dev"]
    resources: ["*"]
    verbs: ["*"]
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: knative-flows-namespaced-admin
  labels:
    eventing.knative.dev/release: devel
    rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
  - apiGroups: ["flows.knative.dev"]
    resources: ["*"]
    verbs: ["*"]
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: knative-eventing-sources-namespaced-admin
  labels:
    eventing.knative.dev/release: devel
    rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
  - apiGroups: ["sources.eventing.knative.dev"]
    resources: ["*"]
    verbs: ["*"]
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: knative-sources-namespaced-admin
  labels:
    eventing.knative.dev/release: devel
    rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
  - apiGroups: ["sources.knative.dev"]
    resources: ["*"]
    verbs: ["*"]

---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: knative-eventing-namespaced-edit
  labels:
    rbac.authorization.k8s.io/aggregate-to-edit: "true"
    eventing.knative.dev/release: devel
rules:
  - apiGroups: ["eventing.knative.dev", "messaging.knative.dev", "sources.eventing.knative.dev", "sources.knative.dev", "flows.knative.dev"]
    resources: ["*"]
    verbs: ["create", "update", "patch", "delete"]
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: knative-eventing-namespaced-view
  labels:
    rbac.authorization.k8s.io/aggregate-to-view: "true"
    eventing.knative.dev/release: devel
rules:
  - apiGroups: ["eventing.knative.dev", "messaging.knative.dev", "sources.eventing.knative.dev", "sources.knative.dev", flows.knative.dev]
    resources: ["*"]
    verbs: ["get", "list", "watch"]
