'Check whether permission-relevant settings have changed
during the request, and clear the cache if so.'

def check_settings(self):

    clear_cache = False
    settings = current.deployment_settings
    record_approval = settings.get_auth_record_approval()
    if (record_approval != self.record_approval):
        clear_cache = True
        self.record_approval = record_approval
    strict_ownership = settings.get_security_strict_ownership()
    if (strict_ownership != self.strict_ownership):
        clear_cache = True
        self.strict_ownership = strict_ownership
    if clear_cache:
        self.clear_cache()
