Default to a encryption context when multiple available contexts

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2014 09:08 AM
We currently have a need for two encryption contexts in our HR application.
One covers all the users of that application, the second covers a certain group within those users, so this group has two contexts of which to choose.
The reason for the second is to allow the attachment of sensitive documentation above and beyond what is normally encrypted in certain fields on the incident.
What I would like to do is always default to the general context so that they must choose the higher level each time they excrypt an attachment.
The higher level would only be used for attachments.
What I am trying to avoid is for them to have their context set to the higher level without knowing it and encrypting one of the fields that the other context must see.
i.e. They encrypt a document to the more secure context and then fill in an encrypted field which if they are the first to enter data, would be encrypted under the more secure context and be unavailable to the other groups with the lower context.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2015 12:02 PM
Hi Steve,
If a user is having more than one Encrpytion context , then he can basically select his present context by using the Encryption Context picker. And then whatever the user encrypts be it a field value or a attachment , that will be encrypted using the context selected.
You can bring the encryption picker on the page by enabling UI macro given in the below mentioned wiki link.
http://wiki.servicenow.com/index.php?title=Encryption_Support
And if you want to set the current encryption context in script , then you can make use of the below mentioned code.
"GlideSession.get().getEncryptionContext().setCurrent(encryptionID);"
Hope this will be helpful to you.
Regards
Pratul Agarwal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2015 06:51 AM
We do have the encryption picker enabled, but I guess what I would really like is a way to force a context on a field by field basis.
Something like a attribute on the dictionary of the field would be great.
We were just worried that our users with the higher context would be mistakenly using the wrong context and effectively locking out the lower context on fields they must see. So far, it does not appear to be an issue, but if it does, I will try the script route.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2015 07:42 AM
Hi Steve,
OOB you can not make different encryption context for different fields, but still you can do it via business rule.
You can make decision is the business rule to enforce a encryption context.
current."field name".setDisplayValue(string);
GlideSession.get().getEncryptionContext().setCurrent(sys_id of the encryption context you want to enforce);
The above lines of code might help.
Regards
Pratul Agarwal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2016 11:51 AM
Pratul Agarwal,
Can you please guide me on how to implement the above piece of code using BR.
Basically I'm planning to set default encryption context based on role.
if users are from xyz team or has role xyz...set default encryption context.
Any help would be highly appreciated.
Thanks
Praneeth