Member Junction
    Preparing search index...

    Function dispatchShareNotificationAfterSave

    • Post-save share-notification dispatcher for extended permission entities. Call immediately after super.Save(options) returns true:

      const saved = await super.Save(options);
      if (saved) {
      await dispatchShareNotificationAfterSave(this, isNewShare, async (provider, grantorId) => {
      return { Provider: provider, ContextUser: this.ContextCurrentUser, … };
      });
      }
      return saved;

      Handles the boilerplate each previous implementation repeated:

      • bail on client-side saves (ProviderType !== 'Database')
      • bail on updates (isNewShare === false)
      • resolve the effective grantor ID (falls back to ContextCurrentUser.ID)
      • let payloadBuilder return null to skip (e.g., Role-grantee ACRs)
      • fire-and-forget via void CreateShareNotification(...) — notification failures never fail the save.

      Parameters

      Returns Promise<void>