Subscription Grants

Subscription grants allow assigning user groups for when a subscription is created or deleted.Β On your Craft CMS dashboard go to Settings -> Subscription Grants

Add the following webhook (opens new window) events on your Stripe dashboard are required:

  • customer.subscription.created
  • customer.subscription.deleted

# Validate Grants on your templates

To check permissions on your templates you can use the following two methods:

{# isInGroup example #}
{% if currentUser.isInGroup('groupHandle') %}

{# can example #}
{% if currentUser.can('permissionName') %}

{# can example 2 #}
{% if currentUser.can("createEntries:#{section.uid}") %}

Stripe subscription grants index

Stripe subscription grants edit