[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Uniqueness constraint over multiple attributes

On 06/29/2012 01:53 PM, Andrew Findlay wrote:
On Thu, Jun 28, 2012 at 05:59:41PM +0200, Jan Beerden wrote:

On 06/20/2012 09:35 PM, Andrew Findlay wrote:
The requirement for the primaryMail value to also appear as an
aliasMail value could be enforced using the constraint overlay
with the 'set' mechanism, something like: overlay constraint
constraint_attribute primaryMail,aliasMail set "this/primaryMail &
restrict="ldap:///o=myorg??sub?(objectClass=mailUser)" Andrew
This seamed to work at first but what this actually does is that it
forces a new aliasMail to already exist in it's own either
primaryMail or aliasMail.
Sorry - I don't understand that. Could you post some examples of what
works and what does not? It would be a good idea to include the slapd
configuration too.

This is what I did:

dn: cn=module{0},cn=config
changetype: modify
add: olcModuleLoad
olcModuleLoad: constraint

dn: olcOverlay=constraint,olcDatabase={1}hdb,cn=config
changetype: add
objectClass: olcOverlayConfig
objectClass: olcConstraintConfig
olcOverlay: constraint
olcConstraintAttribute: mail,mailAliases set "this/mail & this/mailAliases" restrict="ldap:///dc=company,dc=be??sub?(objectClass=mail-user)"

I created the following users:
    userA with mail userA@company.be
    userB with mail userB@company.be

When I try to create an alias for userA, it wil refuse everything accept the value of it's mail address.
So for userA I can only create an alias userA@company.be.
The same applies for userB.

Kind regards


Jan Beerden                                   jan.beerden@fks.be
fks bvba - Formal and Knowledge Systems       http://www.fks.be/
Schampbergstraat 32                           Tel:  ++32-(0)11-21 49 11
B-3511 Kuringen                               Fax:  ++32-(0)11-22 04 19