def on_before_transform_template(self, template_dict):
template = SamTemplate(template_dict)<EOL>intrinsic_resolvers = self._get_intrinsic_resolvers(template_dict.get('<STR_LIT>', {}))<EOL>service_call = None<EOL>if self._validate_only:<EOL><INDENT>service_call = self._handle_get_application_request<EOL><DEDENT>else:<EOL><INDENT>service_call = self._handle_create_cfn_template_request<EOL><DEDENT>for logical_id, app in template.iterate(SamResourceType.Application.value):<EOL><INDENT>if not self._can_process_application(app):<EOL><INDENT>continue<EOL><DEDENT>app_id = self._replace_value(app.properties[self.LOCATION_KEY],<EOL>self.APPLICATION_ID_KEY, intrinsic_resolvers)<EOL>semver = self._replace_value(app.properties[self.LOCATION_KEY],<EOL>self.SEMANTIC_VERSION_KEY, intrinsic_resolvers)<EOL>if isinstance(app_id, dict) or isinstance(semver, dict):<EOL><INDENT>key = (json.dumps(app_id), json.dumps(semver))<EOL>self._applications[key] = False<EOL>continue<EOL><DEDENT>key = (app_id, semver)<EOL>if key not in self._applications:<EOL><INDENT>try:<EOL><INDENT>if not self._sar_client:<EOL><INDENT>self._sar_client = boto3.client('<STR_LIT>')<EOL><DEDENT>service_call(app_id, semver, key, logical_id)<EOL><DEDENT>except InvalidResourceException as e:<EOL><INDENT>self._applications[key] = e<EOL><DEDENT><DEDENT><DEDENT>
Hook method that gets called before the SAM template is processed.
The template has passed the validation and is guaranteed to contain a non-empty "Resources" section.

This plugin needs to run as soon as possible to allow some time for templates to become available.
This verifies that the user has access to all specified applications.

:param dict template_dict: Dictionary of the SAM template
:return: Nothing