Feat: Add default permissions to most plugins (#1460)

* Add default permissions to most plugins.

Co-authored-by: chippers <chip@chip.sh>
Co-authored-by: fabianlars <fabianlars@fabianlars.de>

* updated default description

* mobile plugin relevant changes

---------

Co-authored-by: chippers <chip@chip.sh>
Co-authored-by: fabianlars <fabianlars@fabianlars.de>
This commit is contained in:
Tillmann
2024-06-26 14:35:08 +09:00
committed by GitHub
parent f1372adc9d
commit 0cb1baf09a
73 changed files with 1211 additions and 37 deletions
+11
View File
@@ -8,6 +8,17 @@ const COMMANDS: &[&str] = &[
"is_permission_granted",
"register_action_types",
"register_listener",
"cancel",
"get_pending",
"remove_active",
"get_active",
"check_permissions",
"show",
"batch",
"list_channels",
"delete_channel",
"create_channel",
"permission_state"
];
fn main() {
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-batch"
description = "Enables the batch command without any pre-configured scope."
commands.allow = ["batch"]
[[permission]]
identifier = "deny-batch"
description = "Denies the batch command without any pre-configured scope."
commands.deny = ["batch"]
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-cancel"
description = "Enables the cancel command without any pre-configured scope."
commands.allow = ["cancel"]
[[permission]]
identifier = "deny-cancel"
description = "Denies the cancel command without any pre-configured scope."
commands.deny = ["cancel"]
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-check-permissions"
description = "Enables the check_permissions command without any pre-configured scope."
commands.allow = ["check_permissions"]
[[permission]]
identifier = "deny-check-permissions"
description = "Denies the check_permissions command without any pre-configured scope."
commands.deny = ["check_permissions"]
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-create-channel"
description = "Enables the create_channel command without any pre-configured scope."
commands.allow = ["create_channel"]
[[permission]]
identifier = "deny-create-channel"
description = "Denies the create_channel command without any pre-configured scope."
commands.deny = ["create_channel"]
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-delete-channel"
description = "Enables the delete_channel command without any pre-configured scope."
commands.allow = ["delete_channel"]
[[permission]]
identifier = "deny-delete-channel"
description = "Denies the delete_channel command without any pre-configured scope."
commands.deny = ["delete_channel"]
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-get-active"
description = "Enables the get_active command without any pre-configured scope."
commands.allow = ["get_active"]
[[permission]]
identifier = "deny-get-active"
description = "Denies the get_active command without any pre-configured scope."
commands.deny = ["get_active"]
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-get-pending"
description = "Enables the get_pending command without any pre-configured scope."
commands.allow = ["get_pending"]
[[permission]]
identifier = "deny-get-pending"
description = "Denies the get_pending command without any pre-configured scope."
commands.deny = ["get_pending"]
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-list-channels"
description = "Enables the list_channels command without any pre-configured scope."
commands.allow = ["list_channels"]
[[permission]]
identifier = "deny-list-channels"
description = "Denies the list_channels command without any pre-configured scope."
commands.deny = ["list_channels"]
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-permission-state"
description = "Enables the permission_state command without any pre-configured scope."
commands.allow = ["permission_state"]
[[permission]]
identifier = "deny-permission-state"
description = "Denies the permission_state command without any pre-configured scope."
commands.deny = ["permission_state"]
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-remove-active"
description = "Enables the remove_active command without any pre-configured scope."
commands.allow = ["remove_active"]
[[permission]]
identifier = "deny-remove-active"
description = "Denies the remove_active command without any pre-configured scope."
commands.deny = ["remove_active"]
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-show"
description = "Enables the show command without any pre-configured scope."
commands.allow = ["show"]
[[permission]]
identifier = "deny-show"
description = "Denies the show command without any pre-configured scope."
commands.deny = ["show"]
@@ -1,13 +1,42 @@
| Permission | Description |
|------|-----|
|`allow-batch`|Enables the batch command without any pre-configured scope.|
|`deny-batch`|Denies the batch command without any pre-configured scope.|
|`allow-cancel`|Enables the cancel command without any pre-configured scope.|
|`deny-cancel`|Denies the cancel command without any pre-configured scope.|
|`allow-check-permissions`|Enables the check_permissions command without any pre-configured scope.|
|`deny-check-permissions`|Denies the check_permissions command without any pre-configured scope.|
|`allow-create-channel`|Enables the create_channel command without any pre-configured scope.|
|`deny-create-channel`|Denies the create_channel command without any pre-configured scope.|
|`allow-delete-channel`|Enables the delete_channel command without any pre-configured scope.|
|`deny-delete-channel`|Denies the delete_channel command without any pre-configured scope.|
|`allow-get-active`|Enables the get_active command without any pre-configured scope.|
|`deny-get-active`|Denies the get_active command without any pre-configured scope.|
|`allow-get-pending`|Enables the get_pending command without any pre-configured scope.|
|`deny-get-pending`|Denies the get_pending command without any pre-configured scope.|
|`allow-is-permission-granted`|Enables the is_permission_granted command without any pre-configured scope.|
|`deny-is-permission-granted`|Denies the is_permission_granted command without any pre-configured scope.|
|`allow-list-channels`|Enables the list_channels command without any pre-configured scope.|
|`deny-list-channels`|Denies the list_channels command without any pre-configured scope.|
|`allow-notify`|Enables the notify command without any pre-configured scope.|
|`deny-notify`|Denies the notify command without any pre-configured scope.|
|`allow-permission-state`|Enables the permission_state command without any pre-configured scope.|
|`deny-permission-state`|Denies the permission_state command without any pre-configured scope.|
|`allow-register-action-types`|Enables the register_action_types command without any pre-configured scope.|
|`deny-register-action-types`|Denies the register_action_types command without any pre-configured scope.|
|`allow-register-listener`|Enables the register_listener command without any pre-configured scope.|
|`deny-register-listener`|Denies the register_listener command without any pre-configured scope.|
|`allow-remove-active`|Enables the remove_active command without any pre-configured scope.|
|`deny-remove-active`|Denies the remove_active command without any pre-configured scope.|
|`allow-request-permission`|Enables the request_permission command without any pre-configured scope.|
|`deny-request-permission`|Denies the request_permission command without any pre-configured scope.|
|`default`|Allows requesting permission, checking permission state and sending notifications|
|`allow-show`|Enables the show command without any pre-configured scope.|
|`deny-show`|Denies the show command without any pre-configured scope.|
|`default`|This permission set configures which
notification features are by default exposed.
#### Granted Permissions
It allows all notification related features.
|
+23 -1
View File
@@ -1,8 +1,30 @@
"$schema" = "schemas/schema.json"
[default]
description = "Allows requesting permission, checking permission state and sending notifications"
description = """
This permission set configures which
notification features are by default exposed.
#### Granted Permissions
It allows all notification related features.
"""
permissions = [
"allow-is-permission-granted",
"allow-request-permission",
"allow-notify",
"allow-register-action-types",
"allow-register-listener",
"allow-cancel",
"allow-get-pending",
"allow-remove-active",
"allow-get-active",
"allow-check-permissions",
"allow-show",
"allow-batch",
"allow-list-channels",
"allow-delete-channel",
"allow-create-channel",
"allow-permission-state"
]
@@ -294,6 +294,104 @@
"PermissionKind": {
"type": "string",
"oneOf": [
{
"description": "allow-batch -> Enables the batch command without any pre-configured scope.",
"type": "string",
"enum": [
"allow-batch"
]
},
{
"description": "deny-batch -> Denies the batch command without any pre-configured scope.",
"type": "string",
"enum": [
"deny-batch"
]
},
{
"description": "allow-cancel -> Enables the cancel command without any pre-configured scope.",
"type": "string",
"enum": [
"allow-cancel"
]
},
{
"description": "deny-cancel -> Denies the cancel command without any pre-configured scope.",
"type": "string",
"enum": [
"deny-cancel"
]
},
{
"description": "allow-check-permissions -> Enables the check_permissions command without any pre-configured scope.",
"type": "string",
"enum": [
"allow-check-permissions"
]
},
{
"description": "deny-check-permissions -> Denies the check_permissions command without any pre-configured scope.",
"type": "string",
"enum": [
"deny-check-permissions"
]
},
{
"description": "allow-create-channel -> Enables the create_channel command without any pre-configured scope.",
"type": "string",
"enum": [
"allow-create-channel"
]
},
{
"description": "deny-create-channel -> Denies the create_channel command without any pre-configured scope.",
"type": "string",
"enum": [
"deny-create-channel"
]
},
{
"description": "allow-delete-channel -> Enables the delete_channel command without any pre-configured scope.",
"type": "string",
"enum": [
"allow-delete-channel"
]
},
{
"description": "deny-delete-channel -> Denies the delete_channel command without any pre-configured scope.",
"type": "string",
"enum": [
"deny-delete-channel"
]
},
{
"description": "allow-get-active -> Enables the get_active command without any pre-configured scope.",
"type": "string",
"enum": [
"allow-get-active"
]
},
{
"description": "deny-get-active -> Denies the get_active command without any pre-configured scope.",
"type": "string",
"enum": [
"deny-get-active"
]
},
{
"description": "allow-get-pending -> Enables the get_pending command without any pre-configured scope.",
"type": "string",
"enum": [
"allow-get-pending"
]
},
{
"description": "deny-get-pending -> Denies the get_pending command without any pre-configured scope.",
"type": "string",
"enum": [
"deny-get-pending"
]
},
{
"description": "allow-is-permission-granted -> Enables the is_permission_granted command without any pre-configured scope.",
"type": "string",
@@ -308,6 +406,20 @@
"deny-is-permission-granted"
]
},
{
"description": "allow-list-channels -> Enables the list_channels command without any pre-configured scope.",
"type": "string",
"enum": [
"allow-list-channels"
]
},
{
"description": "deny-list-channels -> Denies the list_channels command without any pre-configured scope.",
"type": "string",
"enum": [
"deny-list-channels"
]
},
{
"description": "allow-notify -> Enables the notify command without any pre-configured scope.",
"type": "string",
@@ -322,6 +434,20 @@
"deny-notify"
]
},
{
"description": "allow-permission-state -> Enables the permission_state command without any pre-configured scope.",
"type": "string",
"enum": [
"allow-permission-state"
]
},
{
"description": "deny-permission-state -> Denies the permission_state command without any pre-configured scope.",
"type": "string",
"enum": [
"deny-permission-state"
]
},
{
"description": "allow-register-action-types -> Enables the register_action_types command without any pre-configured scope.",
"type": "string",
@@ -350,6 +476,20 @@
"deny-register-listener"
]
},
{
"description": "allow-remove-active -> Enables the remove_active command without any pre-configured scope.",
"type": "string",
"enum": [
"allow-remove-active"
]
},
{
"description": "deny-remove-active -> Denies the remove_active command without any pre-configured scope.",
"type": "string",
"enum": [
"deny-remove-active"
]
},
{
"description": "allow-request-permission -> Enables the request_permission command without any pre-configured scope.",
"type": "string",
@@ -365,7 +505,21 @@
]
},
{
"description": "default -> Allows requesting permission, checking permission state and sending notifications",
"description": "allow-show -> Enables the show command without any pre-configured scope.",
"type": "string",
"enum": [
"allow-show"
]
},
{
"description": "deny-show -> Denies the show command without any pre-configured scope.",
"type": "string",
"enum": [
"deny-show"
]
},
{
"description": "default -> This permission set configures which\nnotification features are by default exposed.\n\n#### Granted Permissions\n\nIt allows all notification related features.\n\n",
"type": "string",
"enum": [
"default"