function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ken StantonKen Stanton 

Security Superbadge - Step 2

Has anyone completed the Security Superbadge since the updates by Trailhead?  I can't get the Apex tests to pass for Stage 2.  All I get is the (1/2) Test Methods Passed (i.e., 1 test failed) with absolutely no suggestion as to what to do.  

User-added image

Does anyone know what the Apex test is even looking for?  I can't fix what I don't know is broken, so I'm completely stuck.  

Maybe it's this part of the instructions?

"Configure other Salesforce settings related to record-level security to meet the business requirements."

That seems rather ambiguous so I'm not sure if I'm missing some part of the requirements.  

Best Answer chosen by Ken Stanton
Onesh ReddyOnesh Reddy
Hi Ken,
Looks like you might be missing the Sharing rules that allows sharing Records based on Criteria.(As one of the two methods test the Sharing rules)
Also try to read the Error message from the Column.(Error message which is displayed after running the Test).
NOTE : Adjust the Column so that entire Error message is displayed.
User-added image

Create Sharing rules from Sharing settings.
User-added image

Let me know if it helps you.

Best Regards,
Onesh.K

All Answers

Onesh ReddyOnesh Reddy
Hi Ken,
Looks like you might be missing the Sharing rules that allows sharing Records based on Criteria.(As one of the two methods test the Sharing rules)
Also try to read the Error message from the Column.(Error message which is displayed after running the Test).
NOTE : Adjust the Column so that entire Error message is displayed.
User-added image

Create Sharing rules from Sharing settings.
User-added image

Let me know if it helps you.

Best Regards,
Onesh.K
This was selected as the best answer
Ken StantonKen Stanton

Ha!  That whole error frame wasn't visible on my screen for some reason.  I logged in from another computer, and there it was!  The same happened to me with the Developer Console - it shrunk to a tiny size and wouldn't open right until I logged in from another web browser.  Sometimes SFDC is finicky!  

 

So anyway, I finally saw the error and found a setting that was off.  Thanks, Onesh!

Patrick McClellanPatrick McClellan
I was stumped on this one for a while, then was able to view the error message on the BeAwesome test. It said Field Sales shouldn't have access to opportunities created by others. So I went to Sharing Settings, Org-Wide Defaults > Edit > changed Opportunities to Private.

Passed.
Abhirup MukherjeeAbhirup Mukherjee
Thanks to all!! This helped me a lot pass the challenge. @PatrickMcClellan @Onesh @Ken