add missing permissions

pull/2076/head
amrbashir 8 months ago
parent 7c83d8a2aa
commit bfed96bd1c
No known key found for this signature in database
GPG Key ID: BBD7A47A2003FF33

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_POSITIONER__=function(t){"use strict";async function o(t,o={},e){return window.__TAURI_INTERNALS__.invoke(t,o,e)}var e;return"function"==typeof SuppressedError&&SuppressedError,t.Position=void 0,(e=t.Position||(t.Position={}))[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e[e.TopCenter=4]="TopCenter",e[e.BottomCenter=5]="BottomCenter",e[e.LeftCenter=6]="LeftCenter",e[e.RightCenter=7]="RightCenter",e[e.Center=8]="Center",e[e.TrayLeft=9]="TrayLeft",e[e.TrayBottomLeft=10]="TrayBottomLeft",e[e.TrayRight=11]="TrayRight",e[e.TrayBottomRight=12]="TrayBottomRight",e[e.TrayCenter=13]="TrayCenter",e[e.TrayBottomCenter=14]="TrayBottomCenter",t.handleIconState=async function(t){await o("plugin:positioner|set_tray_icon_state",{position:t.rect.position,size:t.rect.size})},t.moveWindow=async function(t){await o("plugin:positioner|move_window",{position:t})},t}({});Object.defineProperty(window.__TAURI__,"positioner",{value:__TAURI_PLUGIN_POSITIONER__})}
if("__TAURI__"in window){var __TAURI_PLUGIN_POSITIONER__=function(t){"use strict";async function o(t,o={},e){return window.__TAURI_INTERNALS__.invoke(t,o,e)}var e;return"function"==typeof SuppressedError&&SuppressedError,t.Position=void 0,(e=t.Position||(t.Position={}))[e.TopLeft=0]="TopLeft",e[e.TopRight=1]="TopRight",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight",e[e.TopCenter=4]="TopCenter",e[e.BottomCenter=5]="BottomCenter",e[e.LeftCenter=6]="LeftCenter",e[e.RightCenter=7]="RightCenter",e[e.Center=8]="Center",e[e.TrayLeft=9]="TrayLeft",e[e.TrayBottomLeft=10]="TrayBottomLeft",e[e.TrayRight=11]="TrayRight",e[e.TrayBottomRight=12]="TrayBottomRight",e[e.TrayCenter=13]="TrayCenter",e[e.TrayBottomCenter=14]="TrayBottomCenter",t.handleIconState=async function(t){await o("plugin:positioner|set_tray_icon_state",{position:t.rect.position,size:t.rect.size})},t.moveWindow=async function(t){await o("plugin:positioner|move_window",{position:t})},t.moveWindowConstrained=async function(t){await o("plugin:positioner|move_window_constrained",{position:t})},t}({});Object.defineProperty(window.__TAURI__,"positioner",{value:__TAURI_PLUGIN_POSITIONER__})}

@ -2,7 +2,11 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
const COMMANDS: &[&str] = &["move_window", "set_tray_icon_state"];
const COMMANDS: &[&str] = &[
"move_window",
"move_window_constrained",
"set_tray_icon_state",
];
fn main() {
tauri_plugin::Builder::new(COMMANDS)

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-move-window-constrained"
description = "Enables the move_window_constrained command without any pre-configured scope."
commands.allow = ["move_window_constrained"]
[[permission]]
identifier = "deny-move-window-constrained"
description = "Denies the move_window_constrained command without any pre-configured scope."
commands.deny = ["move_window_constrained"]

@ -3,7 +3,8 @@
Allows the moveWindow and handleIconState APIs
- `allow-move-window`
- `set-tray-icon-state`
- `allow-move-window-constrained`
- `allow-set-tray-icon-state`
## Permission Table
@ -43,6 +44,32 @@ Denies the move_window command without any pre-configured scope.
<tr>
<td>
`positioner:allow-move-window-constrained`
</td>
<td>
Enables the move_window_constrained command without any pre-configured scope.
</td>
</tr>
<tr>
<td>
`positioner:deny-move-window-constrained`
</td>
<td>
Denies the move_window_constrained command without any pre-configured scope.
</td>
</tr>
<tr>
<td>
`positioner:allow-set-tray-icon-state`
</td>

@ -1,4 +1,8 @@
"$schema" = "schemas/schema.json"
[default]
description = "Allows the moveWindow and handleIconState APIs"
permissions = ["allow-move-window", "set-tray-icon-state"]
permissions = [
"allow-move-window",
"allow-move-window-constrained",
"allow-set-tray-icon-state",
]

@ -304,6 +304,16 @@
"type": "string",
"const": "deny-move-window"
},
{
"description": "Enables the move_window_constrained command without any pre-configured scope.",
"type": "string",
"const": "allow-move-window-constrained"
},
{
"description": "Denies the move_window_constrained command without any pre-configured scope.",
"type": "string",
"const": "deny-move-window-constrained"
},
{
"description": "Enables the set_tray_icon_state command without any pre-configured scope.",
"type": "string",

@ -63,11 +63,13 @@ async fn move_window<R: Runtime>(window: tauri::Window<R>, position: Position) -
#[cfg(feature = "tray-icon")]
#[tauri::command]
async fn move_window_constrained<R: Runtime>(window: tauri::Window<R>, position: Position) -> Result<()> {
async fn move_window_constrained<R: Runtime>(
window: tauri::Window<R>,
position: Position,
) -> Result<()> {
window.move_window_constrained(position)
}
#[cfg(feature = "tray-icon")]
#[tauri::command]
fn set_tray_icon_state<R: Runtime>(

Loading…
Cancel
Save