Skip to content

Commit

Permalink
feat(annotations): document compound permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Citymonstret committed Jan 31, 2024
1 parent 3b76ded commit 7f02c2f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion docs/annotations/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,18 @@ annotationParser.descriptionMapper(string -> Description.of("blablabla " + strin

[`@Permission`](https://javadoc.io/doc/org.incendo/cloud-annotations/latest/org/incendo/cloud/annotations/Permission.html)
can be added to a command method to set the command permission.
Only simple string-permissions can be used.

```java
// Simple string permission.
@Permission("the.permission")

// Compound permissions are also supported.
// - Equivalent to Permission.anyOf:
@Permission(value = { "permission.1", "permission.2" }, mode = Permission.Mode.ANY_OF)
// - Equivalent to Permission.allOf:
@Permission(value = { "permission.1", "permission.2" }, mode = Permission.Mode.ALL_OF)
```

You may use a [builder modifier](#builder-modifiers) to do more complex mappings.

### Proxies
Expand Down

0 comments on commit 7f02c2f

Please sign in to comment.