# Source: 030-message-broker-amq-security.yaml
apiVersion: broker.amq.io/v1beta1
kind: ActiveMQArtemisSecurity
metadata:
  name: security
spec:
  applyToCrNames:
   - brokeramq
  loginModules:
    propertiesLoginModules:
      - name: "prop-module"
        users:
          - name: batch-user
            password: "mysecret"
            roles:
              - batchRole
          - name: application-server
            password: "mysecret"
            roles:
              - userRole
  securityDomains:
    brokerDomain:
      name: "activemq"
      loginModules:
        - name: "prop-module"
          flag: "sufficient"
  securitySettings:
    broker:
      - match: "#"
        permissions:
          - operationType: "createNonDurableQueue"
            roles:
              - admin
          - operationType: "deleteNonDurableQueue"
            roles:
              - admin
          - operationType: "createDurableQueue"
            roles:
              - admin
          - operationType: "deleteDurableQueue"
            roles:
              - admin
          - operationType: "createAddress"
            roles:
              - admin
          - operationType: "deleteAddress"
            roles:
              - admin
          - operationType: "consume"
            roles:
              - admin
              - userRole
              - batchRole
          - operationType: "browse"
            roles:
              - admin
              - userRole
              - batchRole
          - operationType: "send"
            roles:
              - admin
              - userRole
              - batchRole
          - operationType: "manage"
            roles:
              - admin
              - userRole
              - batchRole