12.10.12. ブール演算子を使用したバインドルールの組み合わせ
複雑なバインドルールを作成する場合は、AND、OR、および NOT のブール値演算子を使用すると、複数のキーワードを組み合わせることができます。
バインドルールとブール演算子を組み合わせた構文は以下の通りです。
bind_rule_1 boolean_operator bind_rule_2...
例12.34 ブール演算子を使用したバインドルールの組み合わせ
cn=Administrators,ou=Groups,dc=example,com および cn=Operators,ou=Groups,dc=example,com の両方のグループのメンバーであるユーザーが、ou=People,dc=example,dc=com のエントリーに対して read、search、add、update、delete の操作を実行できるようにするには、次のコマンドを実行します。
# ldapmodify -D "cn=Directory Manager" -W -H ldap://server.example.com -x
dn: ou=People,dc=example,dc=com
changetype: modify
add: aci
aci: (target="ldap:///ou=People,dc=example,dc=com") (version 3.0;
acl "Allow members of administrators and operators group to manage users";
allow (read, search, add, write, delete)
groupdn = "ldap:///cn=Administrators,ou=Groups,dc=example,com" AND
groupdn = "ldap:///cn=Operators,ou=Groups,dc=example,com";)
Directory Server によるブール値演算子の評価方法
Directory Server は以下のルールを使用してブール値演算子を評価します。
左から右へのすべての式。
以下の例では、
bind_rule_1が最初に評価されます。(bind_rule_1) OR (bind_rule_2)一番内側から外側に向かって、親表現が優先されます。
以下の例では、,
bind_rule_2を最初に評価し、次にbind_rule_3を評価します。(bind_rule_1) OR ((bind_rule_2) AND (bind_rule_3))ANDまたはOR演算子の前にNOT。以下の例では、bind_rule_2 が最初に評価されます。
(bind_rule_1) AND NOT (bind_rule_2)ANDおよびOR演算子には優先順位がありません。