# (c) cavaliba.com

#  SIRENE

# -----------------------------------
#  sirene permissions
# -----------------------------------


- classname: _permission
  keyname: p_sirene_access
  description: "SIRENE app access"
  displayname: p_sirene_access

- classname: _permission
  keyname: p_sirene_access_restricted
  description: "SIRENE  access to all restricted messages"
  displayname: p_sirene_access_restricted

- classname: _permission
  keyname: p_sirene_detail
  description: "SIRENE access details"
  displayname: p_sirene_detail

- classname: _permission
  keyname: p_sirene_history
  description: "SIRENE access history"
  displayname: p_sirene_history

- classname: _permission
  keyname: p_sirene_new
  description: "SIRENE create a new notification"
  displayname: p_sirene_new

- classname: _permission
  keyname: p_sirene_update
  description: "SIRENE update a notification"
  displayname: p_sirene_update

- classname: _permission
  keyname: p_sirene_archive
  description: "SIRENE archive a notification"
  displayname: p_sirene_archive


- classname: _permission
  keyname: p_sirene_flushall
  description: "SIRENE archive all active notifications"
  displayname: p_sirene_flushall


- classname: _permission
  keyname: p_sirene_sms_send
  description: "SIRENE SMS Send"
  displayname: p_sirene_sms_send

- classname: _permission
  keyname: p_sirene_sms_journal
  description: "SIRENE SMS Journal"
  displayname: p_sirene_sms_journal

- classname: _permission
  keyname: p_sirene_sms_stat
  description: "SIRENE SMS Stat"
  displayname: p_sirene_sms_stat

# -- public


- classname: _permission
  keyname: p_data_sirene_public_admin
  description: "data_sirene_public admin permission"
  displayname: p_data_sirene_public_admin

- classname: _permission
  keyname: p_data_sirene_public_create
  description: "data_sirene_public create permission"
  displayname: p_data_sirene_public_create

- classname: _permission
  keyname: p_data_sirene_public_read
  description: "data_sirene_public read permission"
  displayname: p_data_sirene_public_read

- classname: _permission
  keyname: p_data_sirene_public_update
  description: "data_sirene_public update permission"
  displayname: p_data_sirene_public_update
      
- classname: _permission
  keyname: p_data_sirene_public_delete
  description: "data_sirene_public delete permission"
  displayname: p_data_sirene_public_delete



# -- template


- classname: _permission
  keyname: p_data_sirene_template_admin
  description: "data_sirene_template admin permission"
  displayname: p_data_sirene_template_admin

- classname: _permission
  keyname: p_data_sirene_template_create
  description: "data_sirene_template create permission"
  displayname: p_data_sirene_template_create

- classname: _permission
  keyname: p_data_sirene_template_read
  description: "data_sirene_template read permission"
  displayname: p_data_sirene_template_read

- classname: _permission
  keyname: p_data_sirene_template_update
  description: "data_sirene_template update permission"
  displayname: p_data_sirene_template_update
      
- classname: _permission
  keyname: p_data_sirene_template_delete
  description: "data_sirene_template delete permission"
  displayname: p_data_sirene_template_delete



# -- message 



- classname: _permission
  keyname: p_data_sirene_message_admin
  description: "data_sirene_message admin permission"
  displayname: p_data_sirene_message_admin

- classname: _permission
  keyname: p_data_sirene_message_create
  description: "data_sirene_message create permission"
  displayname: p_data_sirene_message_create

- classname: _permission
  keyname: p_data_sirene_message_read
  description: "data_sirene_message read permission"
  displayname: p_data_sirene_message_read

- classname: _permission
  keyname: p_data_sirene_message_update
  description: "data_sirene_message update permission"
  displayname: p_data_sirene_message_update
      
- classname: _permission
  keyname: p_data_sirene_message_delete
  description: "data_sirene_message delete permission"
  displayname: p_data_sirene_message_delete





# --------------------------------------------
# sirene roles
# --------------------------------------------

- classname: _role
  keyname: role_sirene_sms
  is_builtin: True
  _action: init
  is_enabled: yes
  displayname: Built-in Sirene direct SMS 
  permissions: 
    - p_sirene_access
    - p_sirene_sms_send
    


- classname: _role
  keyname: role_sirene_admin
  is_builtin: True
  _action: init
  is_enabled: yes
  displayname: Built-in Sirene admin Role
  permissions: 
    - p_sirene_access
    - p_sirene_access_restricted
    - p_sirene_detail
    - p_sirene_history
    - p_sirene_new
    - p_sirene_update
    - p_sirene_archive
    - p_sirene_flushall
    - p_data_sirene_public_admin
    - p_data_sirene_template_admin
    - p_sirene_sms_send
    - p_sirene_sms_journal
    - p_sirene_sms_stat
    - p_home_access
    - p_iam_access
    - p_user_read
    - p_group_read
    - p_data_access


- classname: _role
  keyname: role_sirene_operator
  is_builtin: True
  _action: init
  is_enabled: yes
  displayname: Built-in Sirene Operator Role
  permissions: 
    - p_sirene_access
    - p_sirene_access_restricted
    - p_sirene_detail
    - p_sirene_history
    - p_sirene_new
    - p_sirene_update
    - p_sirene_archive
    - p_sirene_flushall
    - p_data_sirene_public_read
    - p_data_sirene_template_read
    - p_sirene_sms_send
    - p_sirene_sms_journal
    - p_sirene_sms_stat
    - p_home_access
    - p_iam_access
    - p_user_read
    - p_group_read
    - p_data_access
    - p_data_read
    - p_data_app_read
    - p_data_site_read
    - p_data_sitegroup_read





# ---------------------------------------- 
# sirene - enumerate
# ---------------------------------------- 


- classname: _enumerate
  keyname: sirene_category
  is_enabled: True
  _action: init
  displayname: "Sirene Category"
  description: "Sirene Message Category"
  content: |
    - value: "Incident"
    - value: "Maintenance"
    - value: "Information"
    - value: "Security"
    - value: "Test"
    - value: "Crisis"
    - value: "Other"
    - value: "N/A"


- classname: _enumerate
  keyname: sirene_severity
  is_enabled: True
  _action: init
  displayname: "Sirene Severity"
  description: "Sirene Message Severity"
  content: |
    - value: OK
      widget: green_circle
      bgcolor: success
      fgcolor: text-white
    - value: Information
      widget: blue_circle
      bgcolor: info
      fgcolor: text-dark
    - value: Minor
      widget: yellow_circle
      bgcolor: warning
      fgcolor: dark
    - value: Major
      widget: red_circle
      bgcolor: danger
      fgcolor: text-white
    - value: Critical
      widget: black_circle
      bgcolor: dark
      fgcolor: text-white
    - value: Other
      widget: brown_circle
      bgcolor: light
      fgcolor: text-dark
    - value: N/A
      widget: white_circle
      bgcolor: light
      fgcolor: text-dark



# ---------------------------------------- 
# Sirene Public schema
# ---------------------------------------- 

- classname: _schema
  keyname: sirene_public
  _action: init
  is_enabled: True
  displayname: Public Pages
  order: 300
  page: Sirene

  _options:
      icon: fa-globe
      p_admin: p_data_sirene_public_admin
      p_create: p_data_sirene_public_create
      p_read: p_data_sirene_public_read
      p_update: p_data_sirene_public_update
      p_delete: p_data_sirene_public_delete

  description:
    displayname: Description
    order: 100
    dataformat: string
  is_default:
    displayname: Default
    order: 110
    dataformat: boolean
  severity:
    displayname: Severity
    order: 120
    dataformat: enumerate
    dataformat_ext: sirene_severity
  bgcolor:
    displayname: Background Color
    order: 130
    dataformat: string
  fgcolor:
    displayname: Text Color
    order: 140
    dataformat: string
  content:
    displayname: Content
    order: 200
    dataformat: text
    dataformat_ext: html


# ---------------------------------------- 
# Sirene Template schema
# ---------------------------------------- 

- classname: _schema
  keyname: sirene_template
  displayname: Sirene Templates
  _action: init
  is_enabled: True
  order: 310
  page: Sirene

  _options:
      icon: fa-check-square
      p_admin: p_data_sirene_template_admin
      p_create: p_data_sirene_template_create
      p_read: p_data_sirene_template_read
      p_update: p_data_sirene_template_update
      p_delete: p_data_sirene_template_delete

  hint:
    displayname: Hint
    page: Information
    order: 100
    dataformat: string

  category:
    displayname: Category
    page: Information
    order: 110
    dataformat: enumerate
    dataformat_ext: sirene_category

  severity:
    displayname: Severity
    page: Information
    order: 120
    dataformat: enumerate
    dataformat_ext: sirene_severity

  public_page:
    displayname: Public Page
    page: Channels
    order: 130
    dataformat: schema
    dataformat_ext: sirene_public

  is_restricted:
    displayname: Restricted
    page: Channels
    order: 140
    dataformat: boolean

  has_email:
    displayname: Email
    page: Channels
    order: 150
    dataformat: boolean
    default: True

  has_sms:
    displayname: SMS
    page: Channels
    order: 160
    dataformat: boolean
    default: False

  notify_user:
    displayname: Notify Users
    page: Notify to
    order: 310
    dataformat: user
    cardinal_max: 0

  notify_group:
    displayname: Notify Groups
    page: Notify to
    order: 320
    dataformat: group
    cardinal_max: 0

  notify_app:
    displayname: Notify App
    page: Notify to
    order: 330
    dataformat: schema
    dataformat_ext: app
    cardinal_max: 0

  notify_site:
    displayname: Notify site
    page: Notify to
    order: 340
    dataformat: schema
    dataformat_ext: site
    cardinal_max: 0

  content:
    displayname: Content
    page: Content
    order: 400
    dataformat: text
    dataformat_ext: html

  sms_content:
    displayname: SMS Content
    page: SMS Content
    order: 402
    dataformat: text


# ---------------------------------------- 
# Sirene Message schema
# ---------------------------------------- 

- classname: _schema
  keyname: sirene_message
  _action: init
  is_enabled: True
  displayname: Messages
  order: 320
  page: Sirene

  _options:
      icon: fa-file
      p_admin: p_data_sirene_message_admin
      p_create: p_data_sirene_message_create
      p_read: p_data_sirene_message_read
      p_update: p_data_sirene_message_update
      p_delete: p_data_sirene_message_delete


  template:
    displayname: Template
    description: Source Template
    page: Information
    order: 105
    dataformat: string

  category:
    displayname: Category
    page: Information
    order: 110
    dataformat: enumerate
    dataformat_ext: sirene_category

  severity:
    displayname: Severity
    page: Information
    order: 120
    dataformat: enumerate
    dataformat_ext: sirene_severity

  public_page:
    displayname: Public Page
    page: Channels
    order: 130
    dataformat: schema
    dataformat_ext: sirene_public

  is_restricted:
    displayname: Restricted
    page: Channels
    order: 140
    dataformat: boolean

  has_email:
    displayname: Email
    page: Channels
    order: 150
    dataformat: boolean
    default: True

  has_sms:
    displayname: SMS
    page: Channels
    order: 160
    dataformat: boolean
    default: False


  notify_user:
    displayname: Notify Users
    page: Notify to
    order: 210
    dataformat: user
    cardinal_max: 0

  notify_group:
    displayname: Notify Groups
    page: Notify to
    order: 220
    dataformat: group
    cardinal_max: 0

  notify_app:
    displayname: Notify App
    page: Notify to
    order: 230
    dataformat: schema
    dataformat_ext: app
    cardinal_max: 0

  notify_site:
    displayname: Notify site
    page: Notify to
    order: 240
    dataformat: schema
    dataformat_ext: site
    cardinal_max: 0

  notified_username:
    displayname: All notified users
    page: Notify to
    order: 290
    dataformat: string
    cardinal_max: 0

#  Lifecycle

  created_at:
    displayname: Created
    page: Lifecycle
    order: 300
    dataformat: datetime
    
  created_by:
    displayname: Created by
    page: Lifecycle
    order: 310
    dataformat: user

  updated_at:
    displayname: Updated
    page: Lifecycle
    order: 320
    dataformat: datetime
    
  updated_by:
    displayname: Updated by
    page: Lifecycle
    order: 330
    dataformat: user


  removed_at:
    displayname: Removed
    page: Lifecycle
    order: 340
    dataformat: datetime
    
  removed_by:
    displayname: Removed by
    page: Lifecycle
    order: 350
    dataformat: user

  email_count:
    displayname: Emails
    page: Lifecycle
    order: 360
    dataformat: int

  sms_count:
    displayname: SMS
    page: Lifecycle
    order: 362
    dataformat: int


# -- Content

  content:
    displayname: Content
    page: Content
    order: 400
    dataformat: text
    dataformat_ext: html

  sms_content:
    displayname: SMS Content
    page: SMS Content
    order: 402
    dataformat: text

  update:
    displayname: Update(s)
    page: Content
    order: 410
    dataformat: text
    dataformat_ext: json



# ---------------------------------------- 
# dataviews
# ---------------------------------------- 


# -- public

- classname: _dataview
  keyname: sirene_public_default
  target_class: sirene_public
  displayname: Default
  _action: init
  is_enabled: True
  description: Default DataView for Sirene Public Pages
  content: |
    columns:
       - keyname
       - Severity:
            from: severity
       - displayname
       - Description:
            from: description
       - Default:
            from: is_default


# -- template 

- classname: _dataview
  keyname: sirene_template_default
  target_class: sirene_template
  displayname: Default
  _action: init
  is_enabled: True
  description: Default DataView for Sirene Templates
  content: |
    columns:
       - Name:
            from: displayname
       - Category:
            from: category
       - Severity:
            from: severity
       - Hint:
            from: hint


# -- message

- classname: _dataview
  keyname: sirene_message_default
  target_class: sirene_message
  displayname: Default
  _action: init
  is_enabled: True
  description: Default DataView for Sirene Messages
  content: |
    columns:
       - Name:
            from: displayname
       - Category:
            from: category
       - Severity:
            from: severity
       - Created:
            from: created_at
       - Removed:
            from: removed_at
       - Template:
            from: template



# ---------------------------------------- 
# sirene dashboard
# ---------------------------------------- 


- classname: _home
  keyname: sirene
  displayname: Sirene
  description: Sirene
  icon: fa-sun-o
  url: /sirene/private/
  dashboard_section: Services
  sidebar_section: Services
  order: 20
  permission: p_sirene_access
  _action: init


- classname: _home
  keyname: sms
  _action: delete
#  displayname: SMS Sarbacane
#  description: Send SMS
#  icon: fa-paper-plane
#  url: /sirene/private/sms/send/
#  dashboard_section: Services
#  sidebar_section: Services
#  order: 30
#  permission: p_sirene_sms_send
#  _action: init

# Asset Management


- classname: _home
  keyname: data_sirene_template
  _action: delete
#  displayname: Sirene Templates
#  description: Sirene Templates
#  url: /data/private/c/sirene_template/list/
#  dashboard_section: Asset Management
#  sidebar_section: Asset Management
#  icon: fa-check-square
#  order: 230
#  permission: p_data_sirene_template_read
#  _action: init

- classname: _home
  keyname: data_sirene_public
  _action: delete
  #displayname: Sirene Public
#  description: Sirene Public
#  url: /data/private/c/sirene_public/list/
#  dashboard_section: Asset Management
#  sidebar_section: Asset Management
#  icon: fa-globe
#  order: 240
#  permission: p_data_sirene_public_read
#  _action: init


# Logs

- classname: _home
  keyname: sms_stat
  displayname: SMS Stats
  description: SMS Stats
  icon: fa-bar-chart
  url: /sirene/private/sms/stat/
  dashboard_section: Admin
  sidebar_section: Admin
  order: 812
  permission: p_sirene_sms_stat
  _action: init

- classname: _home
  keyname: sms_journal
  displayname: SMS Journal
  description: SMS Journal
  icon: fa-list
  url: /sirene/private/sms/journal/
  dashboard_section: Admin
  sidebar_section: Admin
  order: 814
  permission: p_sirene_sms_journal
  _action: init

# Internal (900)

- classname: _home
  keyname: internal
  _action: delete
#  displayname: Sirene Message
#  description: Internal Schema
#  icon: fa-list
#  url: /data/private/c/sirene_message/list/
#  dashboard_section: Internal
#  sidebar_section: Internal
#  order: 900
#  permission: p_data_admin
#  _action: init
  




# ---------------------------------------- 
# sirene builtin data
# ---------------------------------------- 



- classname: sirene_public
  keyname: public_ok
  _action: init
  severity: OK
  bgcolor: success
  fgcolor: text-white
  displayname: "OK - No public notification"
  is_default: True
  description: "OK Public Page if there is no active public notification"
  content: |
      <p>No recent notification.</p>
      <p>Please connect to access archive or private notifications.</p>
      <p>Cavaliba Team</p>


- classname: sirene_public
  keyname: public_minor
  _action: init
  severity: Minor
  bgcolor: warning
  fgcolor: dark
  displayname: "Minor incident, Minor event"
  description: "This is a public page for minor incident or event"
  content: |
    <p>Minor Incident, Minor Event</p>
    <p>Please connect to access details and follow-up.</p>
    <p>Cavaliba Team</p>


- classname: sirene_public
  keyname: public_major
  _action: init
  severity: Major
  bgcolor: danger
  fgcolor: text-white
  displayname: "Major incident, Major event"
  description: "This is a public page for major incident or event"
  content: |
    <p>Major Incident or Event</p>
    <p>Please connect to access details and follow-up.</p>
    <p>Cavaliba Team</p>


- classname: sirene_public
  keyname: public_critical
  _action: init
  severity: Critical
  bgcolor: dark
  fgcolor: text-white
  displayname: "Critical incident, Critical event"
  description: "This is a public page for critical incident or event"
  content: |
    <p>Critical Incident or Event</p>
    <p>Please connect to access details and follow-up.</p>
    <p>Cavaliba Team</p>


- classname: sirene_public
  keyname: public_info
  _action: init
  severity: Information
  bgcolor: info
  fgcolor: text-dark
  displayname: "Important Information"
  description: "Important Information"
  content: |
    <p>An important information is available.</p>
    <p>Please connect to access details.</p>
    <p>Cavaliba Team</p>


- classname: sirene_public
  keyname: public_maintenance
  _action: init
  severity: Minor
  bgcolor: warning
  fgcolor: dark
  displayname: "Maintenance Information"
  description: "This is a public page for major maintenance events"
  content: |
    <p>A major maintenance is in progress.</p>
    <p>Please connect to access details.</p>
    <p>Cavaliba Team</p>



- classname: sirene_public
  keyname: public_test
  _action: init
  severity: Information
  bgcolor: info
  fgcolor: text-dark
  displayname: "Test Public Page"
  description: "This is a public page for tests - Please ignore."
  content: |
    <p>TEST TEST TEST - This is a test.</p>
    <p>Please connect to access details.</p>
    <p>Cavaliba Team</p>


