Implementing Security Using Junction Object on External Data In Einstein Analytics

Background

Einstein analytics is a power analytics engine that allows you to explore and create analytics dashboards with Salesforce as well as external data. Analytics dashboards and datasets can be created from Salesforce data, external data through connected systems or external data imported using csv files. 

Salesforce advertises that Einstein supports row level security on data sets using either inherited sharing from Salesforce data or using security predicates for custom security mode. More information on these are available in the following links:
In the below solution I aim to describe a solution for implementing security on external datasets that are related to Salesforce data that follow a custom security model facilitated through junction object. Essentially a many-to-many sharing model in which many users have access to many records in the external data set.

Solution (Github)

Security Model

In our example the Account object will be used to link to external data. Custom security model is implemented on the Account object using a junction object called User Account Assignment. The key point in the security model is that a single account can be shared by multiple users. The diagram below shows a visual representation of the security model.


In the above example User 1 has access to Account 1 and User 2 has access to Account 1 and Account 2. The below screenshot shows the User Account Assignments in my analytics developer org which I will use to implement the security in Einstein analytics on an external dataset of orders that relate to the account record using the account number.

Analytics Setup

The snapshot of the orders dataset we will be using in our demo is shown below. The key field in the dataset is the Account_Number field which maps the order to a Salesforce account record. 


The key to the solution is to extract the User Account Assignment records (formula field to expose account number for join key is needed) and join the external orders dataset using the account number. The purpose of the join is to add a user id column to the joint dataset to allow us to a use a security predicate to filter to rows with logged in user's id. The dataflow and the definition (.json) in the dataflow are shown below. The dataflow creates a joint dataset that replicated order rows for every user account assignment that is matched.


OrdersWithAccountAssignments.wdf

{
  "sfdcDigest_UserAccountAssignment": {
    "action": "sfdcDigest",
    "parameters": {
      "fields": [
        {
          "name": "Account_Number__c"
        },
        {
          "name": "User__c"
        }
      ],
      "object": "User_Account_Assignment__c"
    }
  },
  "OrdersWithUsers": {
    "action": "sfdcRegister",
    "parameters": {
      "name": "OrdersWithUsers",
      "alias": "OrdersWithUsers",
      "source": "augment_OrdersWith"
    }
  },
  "edgemart_Orders": {
    "action": "edgemart",
    "parameters": {
      "alias": "Orders"
    }
  },
  "augment_OrdersWith": {
    "action": "augment",
    "parameters": {
      "right_key": [
        "Account_Number__c"
      ],
      "left": "edgemart_Orders",
      "left_key": [
        "Account_Number"
      ],
      "right_select": [
        "User__c"
      ],
      "right": "sfdcDigest_UserAccountAssignment",
      "relationship": "UserAccountAssignment",
      "operation": "LookupMultiValue"
    }
  }
}

In the above definition json you can see the that the order records are augmented with the User Account Assignment records using the Account_Number__c key and registered into a new dataset called OrdersWithUsers. This dataset is the joint dataset where we will apply the security predicate to filter the records according to the user. The below screenshot shows the security predicate and the dataset properties.


Demo

For the purposes of the demo we have setup the User Account Assignment records as shown below. So orders associated with Test Account 2 and Test Account 3 will be shown if logged in as me and Test Account 1 and Test Account 2 orders will be shown if logged in as the Test Analytics user in the OrdersWithUsers dataset created with the security predicate applied. The demo video below the screenshot confirms the same.



Conclusion

In conclusion Einstein analytics provides ways to implement security on extracted salesforce data and external data using sharing inheritance and ownership rules. But if your application is using a custom many to many sharing implementation using a junction object. Then special steps need to be taken to output a dataset where a security predicate based on the logged in user can be applied. Hopefully this blog and the repository will help you if you are having issues implementing sharing for a custom security model.

Comments

  1. Computerized reasoning innovation has propelled a far cry in a moderately brief timeframe. ai courses

    ReplyDelete
  2. They're produced by the very best degree developers who will be distinguished for your polo dress creating. You'll find polo Ron Lauren inside exclusive array which include particular classes for men, women. security guards

    ReplyDelete
  3. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. Great work. SecurityInstallers.com.au

    ReplyDelete
  4. I want you to thank for your time of this wonderful read!!! I definately enjoy every little bit of it and I have you bookmarked to check out new stuff of your blog a must read blog! Security Services

    ReplyDelete
  5. The post is written in very a good manner and it contains many useful information for me.


    gexton security alaram system

    ReplyDelete
  6. I love the way you write and share your niche! Very interesting and different! Keep it coming! Data Blending in Tableau

    ReplyDelete

  7. This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.
    data science course in guwahati

    ReplyDelete
  8. This is my first time i visit here and I found so many interesting stuff in your blog especially it's discussion, thank you. Security System Provider

    ReplyDelete
  9. A portion of the organizations have some expertise in specific fields of security administrations, for example, versatile watching, business and private security and different administrations.Construction site security

    ReplyDelete
  10. breach the security We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. Great work.

    ReplyDelete
  11. Is it possible that in the future we can make robots which look just like humans, and you will not be able to tell the difference? And what if one of these individuals ran for president? And what if they won? Yes, I'm not the first person asked this question. artificial intelligence certification

    ReplyDelete
  12. Yes, I'm not the first person asked this question. In fact Isaac Asimov had some great stories along this rationale and line of thinking. He was quite a philosopher, and well before his time, and his science fiction is considered still to this day; best-of-breed. artificial intelligence certification

    ReplyDelete
  13. This change is clear just since the most recent 15 years when the idea of PCs appeared. cyber security course in hyderabad

    ReplyDelete
  14. An effective and well trained security officer with the right training and a security company that 24response will provide the right security plan will contribute to securing the building from unauthorized access.

    ReplyDelete
  15. Thanks for sharing the post.. parents are worlds best person in each lives of individual..they need or must succeed to sustain needs of the family. hikedatabase.com/united-states/hiking-in-rhode-island/

    ReplyDelete
  16. You there, this is really good post here. Thanks for taking the time to post such valuable information. Quality content is what always gets the visitors coming. Multi-User CRM

    ReplyDelete
  17. i never know the use of adobe shadow until i saw this post. thank you for this! this is very helpful. Email Automation

    ReplyDelete
  18. Thanks for taking the time to discuss that, I feel strongly about this and so really like getting to know more on this kind of field. Do you mind updating your blog post with additional insight? It should be really useful for all of us. https://saeonmoruda.com/fake-security-cameras-the-answer-to-less-costly-protection/

    ReplyDelete
  19. This comment has been removed by the author.

    ReplyDelete
  20. I ought to thank you for sharing this article here. This data is critical and conspicuous, which you have shared here. It uncovers how magnificently you handle this subject. Best security services in Birmingham

    ReplyDelete
  21. Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. ip camera

    ReplyDelete
  22. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
    Best Quoting Software

    ReplyDelete
  23. i am always looking for some free stuffs over the internet. there are also some companies which gives free samples. Sydney Security Doors

    ReplyDelete
  24. Wow, cool post. I'd like to write like this too - taking time and real hard work to make a great article... but I put things off too much and never seem to get started. Thanks though. Alarm Monitoring

    ReplyDelete
  25. Wow, cool post. I'd like to write like this too - taking time and real hard work to make a great article... but I put things off too much and never seem to get started. Thanks though. Home Security Systems

    ReplyDelete
  26. First You got a great blog .I will be interested in more similar topics. i see you got really very useful topics, i will be always checking your blog thanks. Security Services london

    ReplyDelete
  27. Home security doors are now increasing in popularity as breaking in becomes as easy as pie for skilled intruders. Indeed, having a strong lock attached to an ordinary door cannot keep your residence safe. To protect your house from forceful attacks, covering your entrance with heavy wood or steel gate would be the best thing to do. Security doors In Melbourne

    ReplyDelete
  28. Wonderlic tests are an arrangement of tests, each assessing the candidate from diverse perspectives. Depending on the position, industry, and nature of work a particular or combination of tests may be able to assist get it the candidate’s capacities. Most of the Wonderlic Tests offer assistance to discover a person’s capacity to take after informational. This, while evaluating the ability to memorize, adjust, apply and unravel issues. From essential abilities like communication to more critical abilities like issue fathoming- the free wonderlic practice test can assess all viewpoints proficiently.

    ReplyDelete
  29. This comment has been removed by the author.

    ReplyDelete
  30. On the off chance that it is necessitated that we utilize the board and chalks to assist understudies with bettering, this is the thing that we ought to do.Security Cameras

    ReplyDelete
  31. Truly, this article is really one of the very best in the history of articles. I am a antique ’Article’ collector and I sometimes read some new articles if I find them interesting. And I found this one pretty fascinating and it should go into my collection. Very good work! vape attic olathe

    ReplyDelete
  32. It is imperative that we read blog post very carefully. I am already done it and find that this post is really amazing. twitter tt

    ReplyDelete
  33. I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. security company in singapore

    ReplyDelete
  34. Major thanks for the blog article. Thanks Again.home automation system

    ReplyDelete
  35. I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. https://security-firms-in-singapore.yolasite.com/

    ReplyDelete
  36. Thank you for taking the time to publish this information very useful! security guard company in Singapore

    ReplyDelete
  37. Any way I’m going to be subscribing for a feed and I hope you article again soon security driver

    ReplyDelete
  38. This article gives the light in which we can observe the reality. This is very nice one and gives indepth information. Thanks for this nice article. https://site-5502143-891-1146.mystrikingly.com/blog/top-2-reliable-security-guard-services-singapore

    ReplyDelete
  39. Remarkable post, the information you have mentioned is really knowledgeable and engaging for us, I really enjoyed reading it. Thanks for sharing. Private Security UK

    ReplyDelete
  40. ADT Home Security Ontario is one the best security system

    ReplyDelete
  41. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. I hope you post again soon. Big thanks for the useful info. Top cyber security company in India

    ReplyDelete
  42. Thanks for a very interesting blog. What else may I get that kind of info written in such a perfect approach? I’ve a undertaking that I am simply now operating on, and I have been at the look out for such info. security service company in cambodia

    ReplyDelete
  43. Nice post. I was checking constantly this blog and I am impressed! Extremely helpful information specially the last part I care for such info a lot. I was seeking this particular information for a very long time. Thank you and good luck. security service in cambodia

    ReplyDelete
  44. Wow, excellent post. I'd like to draft like this too - taking time and real hard work to make a great article. This post has encouraged me to write some posts that I am going to write soon. best cambodian security company

    ReplyDelete
  45. I am happy to find your distinguished way of writing the post. Now you make it easy for me to understand and implement the concept. Thank you for the post. Prince Security Service

    ReplyDelete
  46. This is my first time visit here. From the tons of comments on your articles,I guess I am not only one having all the enjoyment right here! https://securitycompanyincambodia909374955.wordpress.com/2022/01/20/how-to-choose-a-security-company-in-cambodia/

    ReplyDelete
  47. I was reading some of your content on this website and I conceive this internet site is really informative ! Keep on putting up. security guard company in cambodia

    ReplyDelete
  48. Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. security services company to hire

    ReplyDelete
  49. Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me. school security guard

    ReplyDelete
  50. You made such an interesting piece to read, giving every subject enlightenment for us to gain knowledge. Thanks for sharing the such information with us to read this... security company in cambodia

    ReplyDelete
  51. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. https://site-7292086-2773-3965.mystrikingly.com

    ReplyDelete
  52. I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work. https://security-services-are-also-necessary.mystrikingly.com/

    ReplyDelete
  53. Yes, I am entirely agreed with this article, and I just want say that this article is very helpful and enlightening. I also have some precious piece of concerned info !!!!!!Thanks. security company in phnom penh

    ReplyDelete
  54. I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article... private security company

    ReplyDelete
  55. Wow, cool post. I'd like to write like this too - taking time and real hard work to make a great article... but I put things off too much and never seem to get started. Thanks though. cambodian security guard

    ReplyDelete
  56. This is my first time visit to your blog and I am very interested in the articles that you serve. Provide enough knowledge for me. Thank you for sharing useful and don't forget, keep sharing useful info: cambodia security company

    ReplyDelete
  57. This post is very good. i enjoy reading your blog.
    https://manpowersupplyfromnepal.com/

    ReplyDelete
  58. This comment has been removed by the author.

    ReplyDelete

Post a Comment

Popular Posts