Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(distribution): pass distribution to abilities functions #2538

Merged

Conversation

StephanH90
Copy link
Contributor

@StephanH90 StephanH90 commented Oct 26, 2023

Description

Passes the distribution coming from the distribution service to any provided permission functions.

This allows the consumer to do things like this:

const permissions = {
  completeDistribution: ({ navigation }) => {
  const specialPrivilegedGroup = ['1'];

  return navigation.value.controlling.edges.any(({node}) =>
      node.addressedGroups.includes(specialPrivilgedGroup));
  })
}

and therefore showing/hiding buttons depending on the state of the distribution.

@StephanH90 StephanH90 requested a review from anehx October 26, 2023 15:31
@StephanH90 StephanH90 self-assigned this Oct 26, 2023
@StephanH90 StephanH90 merged commit 1cf1593 into projectcaluma:main Oct 27, 2023
53 checks passed
anehx pushed a commit that referenced this pull request Nov 6, 2023
# [12.6.0](v12.5.0...v12.6.0) (2023-11-06)

### Bug Fixes

* add ember-data version check to check if calling `.toArray` on ember-data arrays is deprecated ([#2525](#2525)) ([a719961](a719961))

### Features

* **distribution:** pass distribution to abilities functions ([#2538](#2538)) ([1cf1593](1cf1593))
* enable single- and multiple-choice questions in the inquiry preview ([8c97c44](8c97c44))
@anehx
Copy link
Contributor

anehx commented Nov 6, 2023

🎉 This PR is included in version 12.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@anehx anehx added the released label Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants