@Test public void testGetPermittedOwnAttributes() { final Set<String> permittedAttributes = getPermittedAttributes(principal, ALL_ATTRIBUTES); final Set<String> permittedOwnAttributes = getPermittedOwnAttributes(principal, permittedAttributes); assertTrue(permittedOwnAttributes.contains(GENERALLY_PERMITTED_ATTRIBUTE)); assertTrue(permittedOwnAttributes.contains(PERMITTED_OWN_ATTRIBUTE)); assertFalse(permittedOwnAttributes.contains(NEVER_PERMITTED_ATTRIBUTE)); }
protected Set<String> getPermittedOwnAttributes( final IAuthorizationPrincipal principal, final Set<String> generallyPermittedAttributes) { final Set<String> rslt = new HashSet<>(generallyPermittedAttributes); for (String attr : personAttributeDao.getPossibleUserAttributeNames()) { if (principal.hasPermission( IPermission.PORTAL_USERS, IPermission.VIEW_OWN_USER_ATTRIBUTE_ACTIVITY, attr)) { rslt.add(attr); } } return rslt; }
PersonLookupHelperImpl implements IPersonLookupHelper { protected Set<String> getPermittedOwnAttributes( final IAuthorizationPrincipal principal, final Set<String> generallyPermittedAttributes) { final Set<String> rslt = new HashSet<>(generallyPermittedAttributes); for (String attr : personAttributeDao.getPossibleUserAttributeNames()) { if (principal.hasPermission( IPermission.PORTAL_USERS, IPermission.VIEW_OWN_USER_ATTRIBUTE_ACTIVITY, attr)) { rslt.add(attr); } } return rslt; } }
PersonLookupHelperImpl implements IPersonLookupHelper { protected Set<String> getPermittedOwnAttributes( final IAuthorizationPrincipal principal, final Set<String> generallyPermittedAttributes) { final Set<String> rslt = new HashSet<>(generallyPermittedAttributes); for (String attr : personAttributeDao.getPossibleUserAttributeNames()) { if (principal.hasPermission( IPermission.PORTAL_USERS, IPermission.VIEW_OWN_USER_ATTRIBUTE_ACTIVITY, attr)) { rslt.add(attr); } } return rslt; }  }
PersonLookupHelperImpl implements IPersonLookupHelper { protected Set<String> getPermittedOwnAttributes( final IAuthorizationPrincipal principal, final Set<String> generallyPermittedAttributes) { final Set<String> rslt = new HashSet<>(generallyPermittedAttributes); for (String attr : personAttributeDao.getPossibleUserAttributeNames()) { if (principal.hasPermission( IPermission.PORTAL_USERS, IPermission.VIEW_OWN_USER_ATTRIBUTE_ACTIVITY, attr)) { rslt.add(attr); } } return rslt; }  IPersonAttributeDao getPersonAttributeDao(); void setPersonAttributeDao(IPersonAttributeDao personLookupDao); void setMaxResults(int maxResults); int getMaxResults(); void setSearchThreadCount(int searchThreadCount); void setSearchThreadTimeoutSeconds(long searchThreadTimeoutSeconds); @PostConstruct void initializeSearchExecutor(); @Override Set<String> getQueryAttributes(ExternalContext externalContext); @Override Set<String> getDisplayAttributes(ExternalContext externalContext); @Override IPersonAttributes getSelf(ExternalContext externalContext); @Override List<IPersonAttributes> searchForPeople(
            final IPerson searcher, final Map<String, Object> query); @Override IPersonAttributes findPerson(final IPerson searcher, final String username); }
PersonLookupHelperImpl implements IPersonLookupHelper { protected Set<String> getPermittedOwnAttributes( final IAuthorizationPrincipal principal, final Set<String> generallyPermittedAttributes) { final Set<String> rslt = new HashSet<>(generallyPermittedAttributes); for (String attr : personAttributeDao.getPossibleUserAttributeNames()) { if (principal.hasPermission( IPermission.PORTAL_USERS, IPermission.VIEW_OWN_USER_ATTRIBUTE_ACTIVITY, attr)) { rslt.add(attr); } } return rslt; }  IPersonAttributeDao getPersonAttributeDao(); void setPersonAttributeDao(IPersonAttributeDao personLookupDao); void setMaxResults(int maxResults); int getMaxResults(); void setSearchThreadCount(int searchThreadCount); void setSearchThreadTimeoutSeconds(long searchThreadTimeoutSeconds); @PostConstruct void initializeSearchExecutor(); @Override Set<String> getQueryAttributes(ExternalContext externalContext); @Override Set<String> getDisplayAttributes(ExternalContext externalContext); @Override IPersonAttributes getSelf(ExternalContext externalContext); @Override List<IPersonAttributes> searchForPeople(
            final IPerson searcher, final Map<String, Object> query); @Override IPersonAttributes findPerson(final IPerson searcher, final String username);  }