
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Resources
|
235
Technically, an entire ACL may be listed on one line (e.g., access to * by users
read by * auth
), but by convention, we list each by... statement on its own line;
slapd is smart enough to know that the string
access to marks the beginning of the
next ACL.
While I’m not going to describe ACL syntax in great detail, there are a few impor-
tant points to note. First, ACLs are parsed from top to bottom, and “first match
wins”: they act like a stack of filters. Therefore, it’s crucial that you put specific ACLs
and
by... statements above more general ones.
For example, in Example 7-7 we see an ACL restricting access to the
userPassword
attribute, followed by one applicable to *, meaning the entire LDAP database. Put-
ting the
userPassword ACL first means that the rule “allow users to change their own
passwords” (i.e., access to attrs=userPassword by self write) is an exception to
the more general rule “users may have only read-access to anything” (i.e.,
access to
* by users read
).
Another important point is that access levels are hierarchical. Possible levels are
none,
auth, compare, search, read,andwrite, where none is the lowest level of access and
write is the highest, and where each level includes the rights of all levels lower than
it. These two points, the “first match wins”