Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
www committed Dec 24, 2024
1 parent fadbdb0 commit 7a16cd8
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 98 deletions.
17 changes: 2 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/go
75 changes: 1 addition & 74 deletions docs/src/user/templating/2-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -1430,60 +1430,6 @@ Utilities for handling permission checks.

## Types

<div id="type.PermissionResult" />

### PermissionResult

PermissionResult is an internal type containing the status of a permission check in AntiRaid. The exact contents are undocumented as of now



<div id="type.LuaPermissionResult" />

### LuaPermissionResult

LuaPermissionResult is a type containing the status of a permission check in AntiRaid with prior parsing done for Lua.

```json
{
"result": {
"var": "Ok"
},
"is_ok": true,
"code": "Ok",
"markdown": ""
}
```

#### Fields

- `result` ([PermissionResult](#type.PermissionResult)): The raw/underlying result of the permission check.
- `is_ok` ([bool](#type.bool)): Whether the permission check was successful.
- `code` ([string](#type.string)): The code of the permission check.
- `markdown` ([string](#type.string)): The markdown representation of the permission check.


<div id="type.PermissionCheck" />

### PermissionCheck

PermissionCheck is a type containing the permissions to check for a user.

```json
{
"kittycat_perms": [],
"native_perms": [],
"inner_and": false
}
```

#### Fields

- `kittycat_perms` ([{Permission}](#type.Permission)): The kittycat permissions needed to run the command.
- `native_perms` ([{string}](#type.string)): The native permissions needed to run the command.
- `inner_and` ([bool](#type.bool)): Whether or not the perms are ANDed (all needed) or OR'd (at least one)


<div id="type.Permission" />

### Permission
Expand Down Expand Up @@ -1577,25 +1523,6 @@ Checks if a list of permissions in canonical string form contains a specific per

- `has_perm` ([bool](#type.bool)): Whether the permission is present in the list of permissions as per kittycat rules.

### check_perms

```lua
function check_perms(check: PermissionCheck, member_native_perms: Permissions, member_kittycat_perms: {Permission}): LuaPermissionResult
```

Checks if a permission check passes.

#### Parameters

- `check` ([PermissionCheck](#type.PermissionCheck)): The permission check to evaluate.
- `member_native_perms` ([Permissions](#type.Permissions)): The native permissions of the member.
- `member_kittycat_perms` ([{Permission}](#type.Permission)): The kittycat permissions of the member.


#### Returns

- `result` ([LuaPermissionResult](#type.LuaPermissionResult)): The result of the permission check.



---
Expand Down Expand Up @@ -1665,7 +1592,7 @@ Represents a sting on AntiRaid
"creator": "system",
"target": "user:1945824",
"state": "active",
"created_at": "2024-12-15T19:49:01.996579125Z",
"created_at": "2024-12-24T07:37:48.710918096Z",
"duration": {
"secs": 60,
"nanos": 0
Expand Down
2 changes: 1 addition & 1 deletion infra/Sandwich-Daemon
2 changes: 1 addition & 1 deletion infra/nirn-proxy
2 changes: 1 addition & 1 deletion services/bot
Submodule bot updated 31 files
+0 −1 crates/rust.bot_modules.core/Cargo.toml
+0 −285 crates/rust.bot_modules.core/src/commands.rs
+8 −14 crates/rust.bot_modules.core/src/help.rs
+5 −48 crates/rust.bot_modules.core/src/lib.rs
+0 −271 crates/rust.bot_modules.core/src/modules.rs
+28 −34 crates/rust.bot_modules.core/src/settings.rs
+0 −11 crates/rust.bot_modules.core/src/web.rs
+47 −10 crates/rust.bot_modules.lockdown/src/lib.rs
+67 −97 crates/rust.bot_modules.lockdown/src/settings.rs
+4 −1 crates/rust.bot_modules.moderation/Cargo.toml
+3 −6 crates/rust.bot_modules.moderation/src/cmd.rs
+45 −56 crates/rust.bot_modules.moderation/src/lib.rs
+4 −0 crates/rust.bot_modules.server_backups/Cargo.toml
+16 −21 crates/rust.bot_modules.server_backups/src/cmds.rs
+33 −8 crates/rust.bot_modules.server_backups/src/lib.rs
+0 −1 crates/rust.modules/Cargo.toml
+23 −25 crates/rust.modules/src/cache.rs
+6 −35 crates/rust.modules/src/canonical.rs
+0 −4 crates/rust.modules/src/lib.rs
+0 −283 crates/rust.modules/src/module_config.rs
+16 −69 crates/rust.modules/src/modules.rs
+35 −304 crates/rust.modules/src/permission_checks.rs
+0 −188 crates/rust.modules/src/types.rs
+0 −48 crates/rust.modules/src/utils.rs
+0 −1 crates/rust.rpc_server.bot/Cargo.toml
+35 −74 crates/rust.rpc_server.bot/src/lib.rs
+5 −5 crates/rust.rpc_server.bot/src/settings_execute.rs
+7 −9 crates/rust.rpc_server.bot/src/templating_exec.rs
+6 −53 crates/rust.rpc_server.bot/src/types.rs
+15 −38 src/binutils.rs
+2 −2 src/cmds/bot.rs

0 comments on commit 7a16cd8

Please sign in to comment.