Additional features (block visibility, routes, permissions ...)

Created on 22 July 2024, 11 months ago

Hi! I'm looking to implement the following new features for this module:

* Block conditions for feature flags
* Enabling / disabling of routes via feature flags
* Enabling / disabling of permissions via feature flags
* A twig extension for the "isActive" check of feature flags

Are you interested in having these in the core featureflags module? I could provide a patch for either the core module or a featureflag_extensions submodule.

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany sch4lly

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @sch4lly
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Hi
    The first two sound like a perfect use case for our original feature flag... a module that you install/uninstall.
    The third one makes me feel a bit icky. I would prefer selective preprocess hooks over a global twig extension.

    LR

  • πŸ‡©πŸ‡ͺGermany sch4lly

    Hey!
    In the meantime I published my module here: https://www.drupal.org/project/featureflags_extensions β†’

    The twig extension is just a wrapper for FeatureFlag::isActive($flag_id), usable in twig like this: {% if featureflag_active('flag') %}

    The other two features however are more "intrusive", for the permissions part I found no other solution than overriding the global PermissionsChecker service.

    If you want you can take a look at the code and let me know what you think! I would still be open to include this in the main featureflags module.

  • Status changed to RTBC 6 days ago
  • πŸ‡¨πŸ‡¦Canada colan Toronto πŸ‡¨πŸ‡¦

    Setting to RTBC to get some maintainer eyeballs on this. Nobody's going to start working on this until they sign off on it.

  • πŸ‡¨πŸ‡¦Canada colan Toronto πŸ‡¨πŸ‡¦

    More up-to-date title.

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Hey, I'm happy keeping them separate, core took a different approach (using modules instead of feature flags) so I think the feature set we have here is probably enough for now.

  • πŸ‡¨πŸ‡¦Canada colan Toronto πŸ‡¨πŸ‡¦

    Let's update the status then.

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    I've thought about this overnight and I'd be happy to join forces if the new features came with test coverage. If that's not feasible, then yeah let's keep them separate

  • πŸ‡¨πŸ‡¦Canada colan Toronto πŸ‡¨πŸ‡¦

    Let's just not merge it here until they're in.

Production build 0.71.5 2024