From 7f02c2f9966612bdbcd9c3888a043e3b83c8dddf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= Date: Wed, 31 Jan 2024 19:56:55 +0100 Subject: [PATCH] feat(annotations): document compound permissions --- docs/annotations/index.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/annotations/index.md b/docs/annotations/index.md index ea6002f..c25c651 100644 --- a/docs/annotations/index.md +++ b/docs/annotations/index.md @@ -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