18.14.3.6. get effective rights 結果とアクセスコントロールルールの例
get effective 権限は、get effective rights サブジェクトエントリーに対して有効な ACL に応じて返されます。
たとえば、この ACL が設定され、この例の目的でのみ ACL が設定されます。
dn: dc=example,dc=com objectClass: top objectClass: domain dc: example aci: (target=ldap:///ou=Accounting,dc=example,dc=com)(targetattr="*")(version 3.0; acl "test acl"; allow (read,search,compare) (userdn = "ldap:///anyone") ;) dn: ou=Accounting,dc=example,dc=com objectClass: top objectClass: organizationalUnit ou: Accounting
ACL には dc=example,dc=com サブツリーが含まれていないため、get effective rights 検索では、ユーザーに dc=example,dc=com エントリーに対する権限がないことが表示されます。
例18.46 ACL を設定しない (Directory Manager) Get Effective Rights の結果
# ldapsearch -D "cn=Directory Manager" -W -b "dc=example,dc=com" -E '!1.3.6.1.4.1.42.2.27.9.5.2=:dn:uid=scarter,ou=people,dc=example,dc=com' "(objectclass=*)" "*@person" dn: cn=template_person_objectclass,uid=scarter,ou=people,dc=example,dc=com objectClass: person objectClass: top cn: (template_attribute) sn: (template_attribute) description: (template_attribute) seeAlso: (template_attribute) telephoneNumber: (template_attribute) userPassword: (template_attribute) entryLevelRights: none attributeLevelRights: sn:none, cn:none, objectClass:none, description:none, seeAlso:none, telephoneNumber:none, userPassword:none, aci:none
Directory Manager ではなく通常のユーザーが同じコマンドを実行しようとすると、結果は単に空白になります。
例18.47 ACL を設定しない (通常ユーザー) Get Effective Rights の結果
# ldapsearch -D "uid=scarter,ou=people,dc=example,dc=com" -W -b "dc=example,dc=com" -E '!1.3.6.1.4.1.42.2.27.9.5.2=:dn:uid=scarter,ou=people,dc=example,dc=com' "(objectclass=*)" "*@person"