Skip to content

Commit

Permalink
feat: fix id and permission on creating new Policy (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
janpmeyer committed Sep 13, 2023
1 parent 13704d4 commit 464a5ef
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,24 @@ export class NewPolicyDialogComponent implements OnInit {

onSave() {
if (this.permissionsJson && this.permissionsJson !== '') {
this.policy["permission"] = JSON.parse(this.permissionsJson);
this.policy.permission = JSON.parse(this.permissionsJson);
}

if (this.prohibitionsJson && this.prohibitionsJson !== '') {
this.policy["prohibitions"] = JSON.parse(this.prohibitionsJson);
this.policy.prohibition = JSON.parse(this.prohibitionsJson);
}

if (this.obligationsJson && this.obligationsJson !== '') {
this.policy["obligations"] = JSON.parse(this.obligationsJson);
this.policy.obligation = JSON.parse(this.obligationsJson);
}

this.policy["@context"]="http://www.w3.org/ns/odrl.jsonld"


this.dialogRef.close({
policy: this.policyDefinition.policy,
id: this.policyDefinition.id

policy : this.policyDefinition.policy,
'@id': this.policyDefinition.id
})
}
}

0 comments on commit 464a5ef

Please sign in to comment.