Realm application code and sample data for the Officer's Fishery Information Sharing Hub (O-FISH). The mobile app allows fisheries officers to document and share critical information gathered during a routine vessel inspection. The web app allows agencies to gain insights from the aggregated information.
Apache License 2.0
23
stars
9
forks
source link
Enhanced data sharing between partner agencies #163
Is your feature request related to a problem? Please describe.
Need new data/roles/rules to allow partner agencies to read reports from the donor agency.
Describe the solution you'd like
[x] Don’t change the contents or meaning of partnerAgencies – though we should rename it to make it clear that it refers to what this agency is allowing other agencies to access - outboundPartnerAgencies
[x] Add a new array to the Agency document – inboundPartnerAgencies - where each element contains: a Bool named triaged (defaults to false) to indicated whether the agency-admin has reviewed whether to grant access to the donor agency’s reports to the rest of their own agency; a Bool named agencyWideAccess (defaults to false) to indicate whether all agency members can read the donor agency’s reports; a String named name which is the name of the donor agency
[x] Add an array called inboundPartnerAgencies to the User document (that can only be written to by the agency admin, or a global admin) which is an array of String, where each element is the name of an agency that the user has read-access to. This is written to by the agency/global admin; a regular user can read but not write to it.
[x] A trigger will add or remove an agency's name to other AgencyinboundPartnerAgencies arrays when an Agency document is inserted, updated, replaced, or deleted
[x] All users in an agency can read that agency's inboundPartnerAgencies data
[x] A user of agency myAgency can read (but not write) another agency's reports if the donor agency has myAgency in their outboundPartnerAgencies array and the current date is in bounds and either their own agency has inboundPartnerAgencies[donorAgency].agencyWideAccess set to true or their User document includes donorAgency in inboundPartnerAgencies
Is your feature request related to a problem? Please describe. Need new data/roles/rules to allow partner agencies to read reports from the donor agency.
Describe the solution you'd like
outboundPartnerAgencies
Agency
document –inboundPartnerAgencies
- where each element contains: aBool
namedtriaged
(defaults tofalse
) to indicated whether the agency-admin has reviewed whether to grant access to the donor agency’s reports to the rest of their own agency; aBool
namedagencyWideAccess
(defaults tofalse
) to indicate whether all agency members can read the donor agency’s reports; aString
namedname
which is the name of the donor agencyinboundPartnerAgencies
to theUser
document (that can only be written to by the agency admin, or a global admin) which is an array ofString
, where each element is the name of an agency that the user has read-access to. This is written to by the agency/global admin; a regular user can read but not write to it.Agency
inboundPartnerAgencies
arrays when anAgency
document is inserted, updated, replaced,or deletedinboundPartnerAgencies
datamyAgency
can read (but not write) another agency's reports if the donor agency hasmyAgency
in theiroutboundPartnerAgencies
array and the current date is in bounds and either their own agency hasinboundPartnerAgencies[donorAgency].agencyWideAccess
set to true or theirUser
document includesdonorAgency
ininboundPartnerAgencies