@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix content: <http://purl.org/rss/1.0/modules/content/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<https://lhero.org/?post_type=lh-portfolio-doc&#038;p=150025>
  a sioc:Post ;
  dc:title "Data model and access" ;
  dcterms:identifier 150025 ;
  dc:modified "2026-10-12T03:44:36Z"^^xsd:dateTime ;
  dc:created "2026-10-12T02:58:27Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-addresses/data-model-and-access/> ;
  sioc:has_creator <https://lhero.org/author/1/#account> ;
  sioc:has_container <https://lhero.org/#posts> ;
  content:encoded """<ul class="lh_portfolio-meta"><li><strong>Part of:</strong> <a href="https://lhero.org/portfolio/lh-addresses/">LH Addresses</a></li></ul>
<h2 class="wp-block-heading">Addresses and uses</h2>



<p class="wp-block-paragraph">An address belongs to a user. What it is used for, and by whom, is recorded separately as uses: a use is a site ID plus a type. Site ID 0 is the member&#8217;s own address book; any other site ID means the address has been given to that site&#8217;s organisation as that type. One address can carry several uses, for example residential in the member&#8217;s book and postal for two clubs. There is at most one current address per user, site and type: giving another address the same site and type takes it from the old one.</p>



<h2 class="wp-block-heading">Who can read</h2>



<ul class="wp-block-list">
<li>A user reads all of their own addresses.</li>



<li>The admin capability (<code>install_plugins</code>, filterable) reads everything.</li>



<li>Anyone else reads only the addresses given to a site, in full and with their geocoded point, and only when <code>lh_addresses_site_can_read</code> returns true. LH Membership answers it: the viewer holds the member-data capability on that site (default <code>promote_users</code>) and the subject is a member of the site. Having an account on a site is not membership.</li>
</ul>



<h2 class="wp-block-heading">Who can edit</h2>



<p class="wp-block-paragraph">The owner and the admin capability can edit any of the owner&#8217;s addresses. Site staff who can read an address may edit it only while the member has not taken it into their own book: an address staff entered (for example from an import) is created with a use for that site only and becomes the member&#8217;s once they confirm it.</p>



<h2 class="wp-block-heading">Leaving and deletion</h2>



<p class="wp-block-paragraph">Organisations are entitled to their members&#8217; addresses, so members are not offered a way to withdraw a site&#8217;s use; they maintain their addresses instead. When a member leaves, the site&#8217;s uses are deleted (<code>remove_site_uses()</code>); the addresses stay with the member. Removing a user from a site does the same. Deleting a user from the network deletes their addresses, uses and points.</p>



<h2 class="wp-block-heading">Validation</h2>



<p class="wp-block-paragraph">Each save records a validation status: <code>valid</code>, <code>incomplete</code> (a field the country requires is empty), <code>invalid</code> (the postcode does not match the country&#8217;s pattern, or the country is unknown) or <code>unchecked</code> (the library is not installed). A save is never refused on these grounds.</p>
"""^^rdf:XMLLiteral ;
  sioc:content """Part of: LH Addresses
Addresses and uses



An address belongs to a user. What it is used for, and by whom, is recorded separately as uses: a use is a site ID plus a type. Site ID 0 is the member&#8217;s own address book; any other site ID means the address has been given to that site&#8217;s organisation as that type. One address can carry several uses, for example residential in the member&#8217;s book and postal for two clubs. There is at most one current address per user, site and type: giving another address the same site and type takes it from the old one.



Who can read




A user reads all of their own addresses.



The admin capability (install_plugins, filterable) reads everything.



Anyone else reads only the addresses given to a site, in full and with their geocoded point, and only when lh_addresses_site_can_read returns true. LH Membership answers it: the viewer holds the member-data capability on that site (default promote_users) and the subject is a member of the site. Having an account on a site is not membership.




Who can edit



The owner and the admin capability can edit any of the owner&#8217;s addresses. Site staff who can read an address may edit it only while the member has not taken it into their own book: an address staff entered (for example from an import) is created with a use for that site only and becomes the member&#8217;s once they confirm it.



Leaving and deletion



Organisations are entitled to their members&#8217; addresses, so members are not offered a way to withdraw a site&#8217;s use; they maintain their addresses instead. When a member leaves, the site&#8217;s uses are deleted (remove_site_uses()); the addresses stay with the member. Removing a user from a site does the same. Deleting a user from the network deletes their addresses, uses and points.



Validation



Each save records a validation status: valid, incomplete (a field the country requires is empty), invalid (the postcode does not match the country&#8217;s pattern, or the country is unknown) or unchecked (the library is not installed). A save is never refused on these grounds.
""" ;
  sioc:topic <https://lhero.org/?taxonomy=author&term=cap-1> .

<https://lhero.org/author/1/#account> rdfs:seeAlso <https://lhero.org/author/1/?feed=lhrdf&format=turtle> .
<https://lhero.org/?taxonomy=author&term=cap-1> rdfs:seeAlso <https://lhero.org/?taxonomy=author&term=cap-1&feed=lhrdf&format=turtle> .
