Skip to content

Commit d4468ae

Browse files
committed
plugins/acl: Document how to use group statements to make rulesets
1 parent 6c97193 commit d4468ae

2 files changed

Lines changed: 57 additions & 0 deletions

File tree

.github/actions/spelling/allow.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ libcap
2222
libpcre
2323
libstemmer
2424
libtextcat
25+
lri
2526
lto
2627
mharden
2728
mmaped

docs/core/plugins/acl.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,62 @@ namespace shared {
113113
#acl_username = %{master_user}
114114
```
115115

116+
### Creating rule sets with group
117+
118+
You can also simplify ACL rule set management by defining rule sets.
119+
Group settings expand as configuration where they are used,
120+
so they can include values from other filters too.
121+
122+
```[dovecot.conf]
123+
# define rule sets
124+
125+
group @acl_rule_set set1 {
126+
acl user=user1 {
127+
rights = lri
128+
}
129+
}
130+
131+
group @acl_rule_set set2 {
132+
acl user=user2 {
133+
rights = lri
134+
}
135+
}
136+
137+
group @acl_rule_set set3 {
138+
acl user=user3 {
139+
rights = lri
140+
}
141+
}
142+
143+
group @acl_rule_set default {
144+
acl user=admin {
145+
rights = lwristepai
146+
}
147+
}
148+
149+
namespace public {
150+
@acl_rule_set = default
151+
mailbox "Secret" {
152+
@acl_rule_set = set1
153+
}
154+
mailbox "TopSecret" {
155+
@acl_rule_set = set2
156+
}
157+
mailbox "Foo*" {
158+
@acl_rule_set = set3
159+
}
160+
mailbox "FooBar" {
161+
@acl_rule_set = set1
162+
}
163+
}
164+
```
165+
166+
With this configuration user `admin` will have full rights to all folders under public unless negated.
167+
Folders `Secret` and `FooBar` will have `user1` with rights, while folders `TopSecret` has `user2` with rights.
168+
This includes user `admin` from namespace level.
169+
170+
User `user3` will have rights on anything that starts with `Foo`, including `FooBar`.
171+
116172
## Master Users
117173

118174
::: info

0 commit comments

Comments
 (0)