| /***************************************************************************** |
| * Copyright (c)2020 CEA LIST, Committer Name, and others. |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * CEA LIST - Initial API and implementation |
| * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr |
| * Gabriel Pedroza (CEA LIST) gabriel.pedroza@cea.fr |
| *****************************************************************************/ |
| package org.eclipse.papyrus.pdp4eng.req.metareq |
| |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.Fairly |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.Lawful |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.ProcessPrinciple |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.Transparency |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.PurposeLimitation |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.Accuracy |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.StorageLimitation |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.SecuritySafety |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.DataMinimisation |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.LawfulByConsent |
| |
| class GDPRRequirements { |
| /** |
| * get Description for lawfull requirements from rticle5.1 |
| */ |
| def getDescriptionForLawfulRequirement(Lawful lawful){ |
| '''IF process "«lawful.process.base_NamedElement.name»" processes "«getPersonalDataFromProcess(lawful)»" of "«lawful.dataSubject.base_NamedElement.name»" THEN the Process "«lawful.process.base_NamedElement.name»" shall be lawfull.''' |
| } |
| |
| |
| def getDescriptionForLawfulByConsent(LawfulByConsent lawfulByConsent){ |
| '''Processing "«lawfulByConsent.process.base_NamedElement.name»" shall be lawful if the data subject "«lawfulByConsent.dataSubject.base_NamedElement.name»" has given consent "«lawfulByConsent.consent.base_NamedElement.name»" to the processing of his or her personal data "«getPersonalDataFromProcess(lawfulByConsent)»" for one or more specific purposes «lawfulByConsent.process.contributedTo.base_NamedElement.name»''' |
| } |
| |
| |
| /** |
| * get Description for fairly requirements from article5.1 |
| */ |
| def getDescriptionForFairlyRequirement(Fairly fairly){ |
| |
| '''IF process "«fairly.process.base_NamedElement.name»" processes "«getPersonalDataFromProcess(fairly)»" of "«fairly.dataSubject.base_NamedElement.name»" THEN the Process "«fairly.process.base_NamedElement.name»" shall be fairly.''' |
| } |
| /** |
| * get Description for transparent requirements from article5.1 |
| */ |
| def getDescriptionForTransparentRequirement(Transparency transparency){ |
| |
| '''IF process "«transparency.process.base_NamedElement.name»" processes "«getPersonalDataFromProcess(transparency)»" of "«transparency.dataSubject.base_NamedElement.name»" THEN the Process "«transparency.process.base_NamedElement.name»" shall be transparent.''' |
| } |
| /** |
| * get Description for transparent requirements from article5.1.b |
| */ |
| def getDescriptionForPurposeLimitation(PurposeLimitation purposeLimitation){ |
| |
| '''The purpose "«purposeLimitation.purpose.base_NamedElement.name»" of the PersonalData "«purposeLimitation.personalData.base_NamedElement.name»" shall be specified, explicit, legimate, and compatible.''' |
| } |
| |
| /** |
| * get Description for transparent requirements from article5.1.c |
| */ |
| def getDescriptionForDataMinimisation(DataMinimisation dataMinimisation){ |
| |
| '''Personal Data "«dataMinimisation.personalData.base_NamedElement.name»" shall be adequate, relevant and limited to what is necessary in relation to the purpose "«dataMinimisation.purpose.base_NamedElement.name»" for which they are processed''' |
| } |
| /** |
| * get Description for transparent requirements from article5.1.d |
| */ |
| def getDescriptionForAccurate(Accuracy accuracy){ |
| '''Personal Data "«accuracy.personalData.base_NamedElement.name»" shall be accurate and, where necessary, kept up to date. If personal data "«accuracy.personalData.base_NamedElement.name»" are inaccurate, having regard to the purposes "«accuracy.purpose.base_NamedElement.name»" for which they are processed, it shall erased or rectified without delay.''' |
| } |
| /** |
| * get Description for transparent requirements from article5.1.e |
| */ |
| def getDescriptionForStorageLimitation(StorageLimitation storageLimitation){ |
| '''Personal Data "«storageLimitation.personalData.base_NamedElement.name»" shall be kept in a form which permits identification of data subject "«storageLimitation.personalData.relatedTo.get(0).base_NamedElement.name»" for no longer than is necessary for the purpose "«storageLimitation.purpose.base_NamedElement.name»" for which the personal data are processed''' |
| |
| } |
| |
| /** |
| * get Description for transparent requirements from article5.1.e |
| */ |
| def getDescriptionForSecuritySafety(SecuritySafety securitySafety){ |
| '''Personal Data «getPersonalDataFromProcess(securitySafety)» shall be processed in a manner that ensures appropriate security. ''' |
| } |
| |
| def getPersonalDataFromProcess(ProcessPrinciple ProcessPrinciple){ |
| var result = "" |
| |
| for (element : ProcessPrinciple.personalData) { |
| result=result+ element.base_NamedElement.name+" "; |
| } |
| return result |
| } |
| |
| |
| } |