BiologicalRecordsCentre / ABLE

Assessing ButterfLies in Europe project repository
2 stars 3 forks source link

Fix handling of protected records #594

Closed JimBacon closed 1 year ago

JimBacon commented 1 year ago

There are workflow rules which cause occurrences of certain taxa to be marked confidential or sensitive when recorded. There is also an outstanding issue to be able to mark samples as private.

Making records Private or Sensitive causes the location information used for public display to be blurred. Confidential records should not be publicly displayed at all.

Known issues

szabadfalvi commented 1 year ago

I am not sure, i got the point of these intricate masking categories. Wouldn't be enough to use Sensitive Site (Site level) + Sensitive Sp. (occurrence level), in parallel with masking the corresponding tracks (for single sp. 15 min surveys)?

JimBacon commented 1 year ago

The three categories are part of the standard recording software that we have used to build the EBMS website. It has evolvled over many years to handle all the possibilites we have encountered. EBMS may not need them all.

If we are clear about the different ways we want to restrict records then it should be clear which features are best to use. Currently we have workflow rules which make some occurrences Sensitive and some Confidential.

JimBacon commented 1 year ago

To review all the current pages where occurrences can be accessed, to see how the pages handle sensitivity and confidentiality, I created training records in both the transect survey and the 15-minute survey for

The general findings were:

JimBacon commented 1 year ago

Continuing investigation, there are 3 Elasticsearch endpoints in use: es-able, es-able-admin, es-able-samples-admin.

These map on to 3 aliases on Elasticsearch indexes having filter criteria in their definitions as follows:

es-able Maps to alias occurrence_search_able on the index occurrence_brc1_v1

metadata.confidential:false AND 
metadata.release_status:R ((metadata.sensitivity_blur:B) OR (!metadata.sensitivity_blur:*)) AND
metadata.website.id: [118,140]

es-able-admin Maps to aliasoccurrence_search_able_admin on the index occurrence_brc1_v1

metadata.confidential:false AND 
metadata.release_status:R AND 
((metadata.sensitivity_blur:F) OR (!metadata.sensitivity_blur:*)) AND
metadata.website.id: [118,140]

es-able-samples-admin Maps to alias occurrence_search_able_samples_admin on the index sample_brc1_v1

metadata.confidential:false AND 
metadata.release_status:R AND 
((metadata.sensitivity_blur:F) OR (!metadata.sensitivity_blur:*)) AND
metadata.website.id: 118

Various things leap out.

However, removing the filter on confidential records does not make them magically appear. This is because client_helpers/ElasticsearchProxyHelper.php::buildEsQueryFromRequest() contains the following:

    if (!self::$confidentialFilterApplied) {
      // Unless explicitly specified in a filter, hide confidential.
      $bool['must'][] = ['term' => ['metadata.confidential' => FALSE]];
    }

This is requiring a filter to be created explicitly giving the user permission to see confidential records.

JimBacon commented 1 year ago

Another thing to look into. Some records of a species that have a workflow rule to mark them sensitive have the flag set and some do not. For example compare

CrisSevilleja commented 1 year ago

Why are they different on the sensitivity flag? same species, in the same area

JimBacon commented 1 year ago

I have resolved the duplication of sensitive records and the vanishing confidential records by making the following changes:

DavidRoy commented 1 year ago

@CrisSevilleja - the main requirements of this are now met. Can you confirm with @szabadfalvi and others. We'll then close this issue and open new issues for related tasks

szabadfalvi commented 1 year ago

Hi All, Yes, it seems that sensitive spp. (oedippus + maturna i checked) are now included in the downloads (as well as the Life Stage). This issue seems "swell" now :-) &

On Wed, Aug 30, 2023 at 11:22 AM David Roy (CEH) @.***> wrote:

@CrisSevilleja https://github.com/CrisSevilleja - the main requirements of this are now met. Can you confirm with @szabadfalvi https://github.com/szabadfalvi and others. We'll then close this issue and open new issues for related tasks

— Reply to this email directly, view it on GitHub https://github.com/BiologicalRecordsCentre/ABLE/issues/594#issuecomment-1698808619, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWHE6CHM5BBW5YNMECGXEYDXX4A53ANCNFSM6AAAAAAZW4DJYE . You are receiving this because you were mentioned.Message ID: @.***>