generated from CodeForBaltimore/ProjectTemplate
-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
bugSomething isn't workingSomething isn't workingtech debtRemediation work implied by intentional partial or sub-optimal implmentationRemediation work implied by intentional partial or sub-optimal implmentation
Description
Describe the bug
When a contact is associated with facility created we create a Casbin policy to allow that contact to view that the associated facility. This, coupled with short lived tokens, enable the self check-in functionality. Currently, any edits to an email address do not result in updates to the policy.
To Reproduce
Steps to reproduce the behavior:
- Perform self check in with an existing contact that has an email address
- Update the email address of that contact
- Attempt another self check in
Expected behavior
The self checkin after email update should succeed.
Environment
n/a
Additional context
The fix should also include removal of the policy associated with the old email address.
Here's the code that was used to create the policy when linking the entity and contact:
if (typeof contact.email !== 'undefined' && contact.email.length > 0) {
for (const email of contact.email) {
const p = [email.address, `/entity/${ec.entityId}`, '(GET)|(POST)']
await e.addPolicy(...p)
}
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingtech debtRemediation work implied by intentional partial or sub-optimal implmentationRemediation work implied by intentional partial or sub-optimal implmentation