handlers.subscription_limiter_handler

class SubscriptionLimiterHandler(handlers.eventhandler.EventHandler):

Allow a maximum of 'n' subscriptions of a single role per fact sheet.

Configuration:

limits: key/value pairs of subscription role names and the limit, e.g.:

"limits": {  
    "System Owner": 1,  
    "RESPONSIBLE": 2,  
}
name = 'Subscription Limiter'
description = 'Limits the number of allowed subscriptions of a certain role or subscription type.'
conditions = {'event_types': ['SubscriptionCreatedEvent']}
config_template = {'limits': {'System Owner': 1, 'RESPONSIBLE': 2}}
def handle(self, event, fact_sheet, **kwargs):

Called automatically whenever an event comes in via Webhook.