| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.rice.kim.ldap; |
| 17 | |
|
| 18 | |
import org.springframework.ldap.core.DirContextOperations; |
| 19 | |
import org.springframework.ldap.core.support.AbstractContextMapper; |
| 20 | |
|
| 21 | |
import org.kuali.rice.kim.api.identity.privacy.EntityPrivacyPreferences; |
| 22 | |
import org.kuali.rice.kim.util.Constants; |
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | 0 | public class EntityPrivacyPreferencesMapper extends AbstractContextMapper { |
| 29 | |
private Constants constants; |
| 30 | |
|
| 31 | |
public Object doMapFromContext(DirContextOperations context) { |
| 32 | 0 | final String entityId = context.getStringAttribute(getConstants().getKimLdapIdProperty()); |
| 33 | 0 | final EntityPrivacyPreferences.Builder person = EntityPrivacyPreferences.Builder.create(entityId); |
| 34 | 0 | person.setSuppressName(false); |
| 35 | 0 | person.setSuppressEmail(false); |
| 36 | 0 | person.setSuppressPhone(false); |
| 37 | 0 | person.setSuppressAddress(false); |
| 38 | 0 | person.setSuppressPersonal(true); |
| 39 | 0 | return person; |
| 40 | |
} |
| 41 | |
|
| 42 | |
|
| 43 | |
|
| 44 | |
|
| 45 | |
|
| 46 | |
|
| 47 | |
public final Constants getConstants() { |
| 48 | 0 | return this.constants; |
| 49 | |
} |
| 50 | |
|
| 51 | |
|
| 52 | |
|
| 53 | |
|
| 54 | |
|
| 55 | |
|
| 56 | |
public final void setConstants(final Constants argConstants) { |
| 57 | 0 | this.constants = argConstants; |
| 58 | 0 | } |
| 59 | |
} |