Skip to content

Instantly share code, notes, and snippets.

@edulix
Last active April 15, 2019 16:09
Show Gist options
  • Select an option

  • Save edulix/732ef3c4a7a23919f741c2bd0de084e4 to your computer and use it in GitHub Desktop.

Select an option

Save edulix/732ef3c4a7a23919f741c2bd0de084e4 to your computer and use it in GitHub Desktop.
import evidence 1.0
Contract {
id: tos
roles: Roles {
user: RoleConstraints {
single: true
auth_method: 'cookies'
}
company: CompanyRole {
id: company
}
}
workflows: WorkFlowList {
CancelContractWorkFlow {
id: cancelContract
}
UpdateCookiesDataWorkFlow {
id: updateCookiesData
}
UpdateContractWorkFlow {
id: updateContract
}
/**
* acceptConsent workflow:
*
* The list of object child elements in the workflow are the sequential
* steps to be executed in this workflow.
*/
SequentialWorkFlow {
id: acceptConsent
title: 'This flows\' objective is to allow the user to accept the ' +
'cookies policy'
Function {
id: getCookies
title: 'Initialize contract'
generate_annex: true
execution: 'auto'
where: 'web-browser'
who: roles.user
code: {
cookies_list = CookiesPolicy.list_cookies();
evidence.roles.user = evidence.get_user_cookie();
}
}
Dialog {
id: acceptDialog
execution: auto
where: web-browser
role: user
title: 'This website uses cookies'
description:
'We use cookies to personalise content and ads, to provide social ' +
'media features and to analyse our traffic. We also share ' +
'information about your use of our site with our social media, ' +
'advertising and analytics partners who may combine it with other ' +
'information that you’ve provided to them or that they’ve ' +
'collected from your use of their services. You consent to our ' +
'cookies if you continue to use our website.<br>' +
'You can <a evi-ref=\"self.showContract\">read our cookies policy ' +
'and customize cookies here</a>'
actions: ActionList {
Button {
id: acceptDialogAccept
title: qsTr('Accept')
onClicked: { Dialog.continue(); }
}
CancelButton {}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment