Created
February 27, 2020 17:08
-
-
Save trevorfoskett/9c01eaf4b170fd056427acdaeae81c2c to your computer and use it in GitHub Desktop.
Construct policy object based on user input.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ipcMain.on('disable-reshare-on', (event) => { | |
disableResharing = true; | |
console.log('Disable Resharing: ' + disableResharing); | |
}) | |
ipcMain.on('disable-reshare-off', (event) => { | |
disableResharing = false; | |
console.log('Disable Resharing: ' + disableResharing); | |
}) | |
//...continue for watermark and expiration... | |
function buildPolicy() { | |
var policy = new Virtru.PolicyBuilder(); | |
if (disableResharing == true) { | |
policy.disableReshare(); | |
} | |
if (watermarking == true) { | |
policy.enableWatermarking(); | |
} | |
if (expiration == true) { | |
policy.enableExpirationDeadline(expirationDate); | |
} | |
return policy.build(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment