handlers.restrict_sharing_handler

class RestrictSharingHandler(handlers.eventhandler.EventHandler):

Restricts sharing of a saved search, report or diagram to a defined list of users. All permissions beyond the defined user list will be deleted. (POC stage).

name = 'Restrict sharing of saved searches, bookmarks and diagrams (POC only)'
description = 'Deletes all permissions of a shared element that exceed the permitted list of users.'
supports_initial_sync = False
conditions = {'event_types': ['BookmarkCreatedEvent', 'BookmarkUpdatedEvent']}
config_template = {'allowed_users': ['3431f4e9-df8b-4601-8509-5d220e0bae08', 'c8bcbdab-fefd-4f4f-8a48-734e39820abc'], 'personal_api_token': 'paste a (deprecated) personal API token here'}
def handle(self, event, fs, **kwargs):

Called automatically whenever a FactSheetUpdated event comes in via webhook.