Skip to content

Commit

Permalink
feat(core): make all tray and menu permissions enable by default (#10092
Browse files Browse the repository at this point in the history
)

* Make all tray and menu permissions on by default

* Update example capabilities

* Add change file
  • Loading branch information
Legend-Master authored Jun 24, 2024
1 parent d4c908c commit cee0bfc
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 66 deletions.
5 changes: 5 additions & 0 deletions .changes/tray-menu-default-permission.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri": "patch:enhance"
---

Make `tray:default` and `menu:default` include all tray and menu permissions
66 changes: 33 additions & 33 deletions core/tauri/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,44 +156,44 @@ const PLUGINS: &[(&str, &[(&str, bool)])] = &[
(
"menu",
&[
("new", false),
("append", false),
("prepend", false),
("insert", false),
("remove", false),
("remove_at", false),
("items", false),
("get", false),
("popup", false),
("create_default", false),
("set_as_app_menu", false),
("set_as_window_menu", false),
("text", false),
("set_text", false),
("is_enabled", false),
("set_enabled", false),
("set_accelerator", false),
("set_as_windows_menu_for_nsapp", false),
("set_as_help_menu_for_nsapp", false),
("is_checked", false),
("set_checked", false),
("set_icon", false),
("new", true),
("append", true),
("prepend", true),
("insert", true),
("remove", true),
("remove_at", true),
("items", true),
("get", true),
("popup", true),
("create_default", true),
("set_as_app_menu", true),
("set_as_window_menu", true),
("text", true),
("set_text", true),
("is_enabled", true),
("set_enabled", true),
("set_accelerator", true),
("set_as_windows_menu_for_nsapp", true),
("set_as_help_menu_for_nsapp", true),
("is_checked", true),
("set_checked", true),
("set_icon", true),
],
),
(
"tray",
&[
("new", false),
("get_by_id", false),
("remove_by_id", false),
("set_icon", false),
("set_menu", false),
("set_tooltip", false),
("set_title", false),
("set_visible", false),
("set_temp_dir_path", false),
("set_icon_as_template", false),
("set_show_menu_on_left_click", false),
("new", true),
("get_by_id", true),
("remove_by_id", true),
("set_icon", true),
("set_menu", true),
("set_tooltip", true),
("set_title", true),
("set_visible", true),
("set_temp_dir_path", true),
("set_icon_as_template", true),
("set_show_menu_on_left_click", true),
],
),
];
Expand Down
35 changes: 2 additions & 33 deletions examples/api/src-tauri/capabilities/run-app.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,37 +66,6 @@
"window:allow-set-icon",
"window:allow-toggle-maximize",
"webview:allow-create-webview-window",
"webview:allow-print",
"menu:allow-new",
"menu:allow-append",
"menu:allow-prepend",
"menu:allow-insert",
"menu:allow-remove",
"menu:allow-remove-at",
"menu:allow-items",
"menu:allow-get",
"menu:allow-popup",
"menu:allow-create-default",
"menu:allow-set-as-app-menu",
"menu:allow-set-as-window-menu",
"menu:allow-text",
"menu:allow-set-text",
"menu:allow-is-enabled",
"menu:allow-set-enabled",
"menu:allow-set-accelerator",
"menu:allow-set-as-windows-menu-for-nsapp",
"menu:allow-set-as-help-menu-for-nsapp",
"menu:allow-is-checked",
"menu:allow-set-checked",
"menu:allow-set-icon",
"tray:allow-new",
"tray:allow-set-icon",
"tray:allow-set-menu",
"tray:allow-set-tooltip",
"tray:allow-set-title",
"tray:allow-set-visible",
"tray:allow-set-temp-dir-path",
"tray:allow-set-icon-as-template",
"tray:allow-set-show-menu-on-left-click"
"webview:allow-print"
]
}
}

0 comments on commit cee0bfc

Please sign in to comment.