Files
probo/pkg/slack/templates/access-request.json.tmpl
2026-01-29 10:56:32 +04:00

271 lines
6.9 KiB
Cheetah

{
"text": "New Compliance Page Access Request",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "🔒 New Compliance Page Access Request"
}
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "👤 Requested by {{if .RequesterName}}*{{jsonEscape .RequesterName}}* {{end}}{{if .RequesterName}}<{{end}}{{jsonEscape .RequesterEmail}}{{if .RequesterName}}>{{end}}"
}
]
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Grant All"
},
"action_id": "accept_all",
"value": "{{.SlackMessageID}}",
"style": "primary"
},
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Reject/Revoke All"
},
"action_id": "reject_all",
"value": "{{.SlackMessageID}}",
"style": "danger"
},
{
"type": "button",
"text": {
"type": "plain_text",
"text": "View Requests"
},
"url": "https://{{.Domain}}/organizations/{{.OrganizationID}}/compliance-page/access"
}
]
}{{if .Documents}},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*📄 Requested Documents*"
}
}{{range .Documents}},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "<https://{{$.Domain}}/organizations/{{$.OrganizationID}}/documents/{{.ID}}|{{jsonEscape .Title}}>"
},
{
"type": "mrkdwn",
{{if eq .Status "GRANTED"}}
"text": "<https://{{$.Domain}}/organizations/{{$.OrganizationID}}/compliance-page/access|✓ Granted>"
{{else if eq .Status "REJECTED"}}
"text": "✗ Rejected"
{{else if eq .Status "REVOKED"}}
"text": "✗ Revoked"
{{else}}
"text": "Requested"
{{end}}
}
],
"accessory": {{if eq .Status "GRANTED"}}{
"type": "button",
"text": {
"type": "plain_text",
"text": "Revoke"
},
"action_id": "reject_document",
"value": "{{.ID}}",
"style": "danger"
}{{else if eq .Status "REQUESTED"}}{
"type": "overflow",
"options": [
{
"text": {
"type": "plain_text",
"text": "Grant"
},
"value": "accept/{{.ID}}"
},
{
"text": {
"type": "plain_text",
"text": "Reject"
},
"value": "reject/{{.ID}}"
}
],
"action_id": "handle_document"
}{{else}}{
"type": "button",
"text": {
"type": "plain_text",
"text": "Grant"
},
"action_id": "accept_document",
"value": "{{.ID}}",
"style": "primary"
}{{end}}
}{{end}}{{end}}{{if .Reports}},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*📊 Requested Audit Reports*"
}
}{{range .Reports}},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "<https://{{$.Domain}}/organizations/{{$.OrganizationID}}/audits/{{.AuditID}}|{{jsonEscape .Title}}>"
},
{
"type": "mrkdwn",
{{if eq .Status "GRANTED"}}
"text": "<https://{{$.Domain}}/organizations/{{$.OrganizationID}}/compliance-page/access|✓ Granted>"
{{else if eq .Status "REJECTED"}}
"text": "✗ Rejected"
{{else if eq .Status "REVOKED"}}
"text": "✗ Revoked"
{{else}}
"text": "Requested"
{{end}}
}
],
"accessory": {{if eq .Status "GRANTED"}}{
"type": "button",
"text": {
"type": "plain_text",
"text": "Revoke"
},
"action_id": "reject_report",
"value": "{{.ID}}",
"style": "danger"
}{{else if eq .Status "REQUESTED"}}{
"type": "overflow",
"options": [
{
"text": {
"type": "plain_text",
"text": "Grant"
},
"value": "accept/{{.ID}}"
},
{
"text": {
"type": "plain_text",
"text": "Reject"
},
"value": "reject/{{.ID}}"
}
],
"action_id": "handle_report"
}{{else}}{
"type": "button",
"text": {
"type": "plain_text",
"text": "Grant"
},
"action_id": "accept_report",
"value": "{{.ID}}",
"style": "primary"
}{{end}}
}{{end}}{{end}}{{if .Files}},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*📎 Requested Files*"
}
}{{range .Files}},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "<https://{{$.Domain}}/organizations/{{$.OrganizationID}}/compliance-page/files|{{jsonEscape .Name}}>{{if .Category}} ({{jsonEscape .Category}}){{end}}"
},
{
"type": "mrkdwn",
{{if eq .Status "GRANTED"}}
"text": "<https://{{$.Domain}}/organizations/{{$.OrganizationID}}/compliance-page/access|✓ Granted>"
{{else if eq .Status "REJECTED"}}
"text": "✗ Rejected"
{{else if eq .Status "REVOKED"}}
"text": "✗ Revoked"
{{else}}
"text": "Requested"
{{end}}
}
],
"accessory": {{if eq .Status "GRANTED"}}{
"type": "button",
"text": {
"type": "plain_text",
"text": "Revoke"
},
"action_id": "reject_file",
"value": "{{.ID}}",
"style": "danger"
}{{else if eq .Status "REQUESTED"}}{
"type": "overflow",
"options": [
{
"text": {
"type": "plain_text",
"text": "Grant"
},
"value": "accept/{{.ID}}"
},
{
"text": {
"type": "plain_text",
"text": "Reject"
},
"value": "reject/{{.ID}}"
}
],
"action_id": "handle_file"
}{{else}}{
"type": "button",
"text": {
"type": "plain_text",
"text": "Grant"
},
"action_id": "accept_file",
"value": "{{.ID}}",
"style": "primary"
}{{end}}
}{{end}}{{end}},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "⚠️ _Updates from this message will only work for 14 days_"
}
]
}
]
}