Skip to content

Commit

Permalink
moving casbin to load only if we have email
Browse files Browse the repository at this point in the history
  • Loading branch information
stoopidJSON committed Feb 27, 2021
1 parent 69815c0 commit 1bc5e71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/models/entity-contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ const entityContact = (sequelize, DataTypes) => {

// Grant perms on checkins
const contact = await models.Contact.findById(ec.contactId)
const e = await utils.loadCasbin()

if (typeof contact.email !== 'undefined' && contact.email.length > 0) {
const e = await utils.loadCasbin()
for (const email of contact.email) {
const p = [email.address, `/entity/${ec.entityId}`, '(GET)|(POST)']
await e.addPolicy(...p)
Expand Down

0 comments on commit 1bc5e71

Please sign in to comment.