Universal Containers implemented a private sharing model for the Account object. A custom Account search tool was developed with
Apex to help sales representatives find accounts that match multiple criteria they specify. Since its release, users of the tool report they can see
Accounts they do not own.
What should the developer use to enforce sharing permissions for the currently logged in user while using the custom search tool?
Suggested Answer: B
Get Premium DEX-450 Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
37 comments · newest first
LA
Lasandra
12 months ago
Isn't there a risk with B? That seems risky for data access.
TE
Teddy
12 months ago
A is correct, it enforces the sharing rules properly.
SH
Shenika
12 months ago
Surprised they can see accounts they don't own at all!
DO
Dorothy
1 year ago
I disagree, I think C makes more sense for filtering.
MI
Mignon
1 year ago
Definitely A, using with sharing is the way to go!
RA
Raylene
1 year ago
I vaguely recall something about schema describe calls, but I don't think they actually enforce sharing. I feel like the answer has to be related to the sharing keyword.
BR
Brock
1 year ago
I think we had a practice question about filtering records based on user permissions. Using userInfo to filter SOQL queries sounds familiar, but I'm not confident it's the best approach here.
RO
Ronnie
1 year ago
I'm not entirely sure, but I feel like "without sharing" would allow users to see more records than they should. That doesn't seem right for this scenario.
AR
Ardella
1 year ago
I remember we discussed the importance of using the "with sharing" keyword to enforce sharing rules. I think that might be the right choice here.
DA
Daisy
1 year ago
Based on my understanding, the Customer Success Manager is the one who works closely with the customer executives to align the purchased solutions with their business goals.
GE
Georgene
1 year ago
Definitely A. You can't just start shopping around without knowing your specific needs first. Classic project management approach.
SA
Sage
1 year ago
The way I see it, the main purpose is to obtain agreement on the requirements, so I'm going to go with option A. Feels like the most straightforward answer.
LA
Lashon
1 year ago
Using without sharing? Bold strategy, Cotton. Let's see if it pays off. Just kidding, that's a hard pass from me. C is the way to go, keep that data safe and sound.
CY
Cyril
1 year ago
Option A with sharing? More like 'with no access' amirite? Gotta go with C on this one, my dudes. Keeping that data locked down is the way to go.
AL
Alline
1 year ago
C) Use the userInfo Apex class to filter all SOQL queries to returned records owned by the logged-in user.
RO
Rolande
1 year ago
B) Use the without sharing keyword on the class declaration.
FR
Freeman
1 year ago
A) Use the with sharing keyword on the class declaration.
JI
Jina
1 year ago
Hmm, schema describe calls? That seems a bit overkill for this use case. Why complicate things when you can just use the userInfo class like in Option C? It's a no-brainer.
MI
Micah
1 year ago
C) Use the userInfo Apex class to filter all SOQL queries to returned records owned by the logged-in user.
AL
Alline
1 year ago
B) Use the without sharing keyword on the class declaration.
IN
In
1 year ago
A) Use the with sharing keyword on the class declaration.
MA
Markus
1 year ago
Whoa, without sharing? That's a bold move, but I wouldn't recommend it. Sounds like a security nightmare waiting to happen. Option C is the clear winner here.
LE
Leota
1 year ago
C) Use the userInfo Apex class to filter all SOQL queries to returned records owned by the logged-in user.
ST
Stephaine
1 year ago
B) Use the without sharing keyword on the class declaration.
XU
Xuan
1 year ago
A) Use the with sharing keyword on the class declaration.
GE
Geraldine
2 years ago
Option C sounds like the way to go. Using the userInfo class to filter the SOQL queries ensures that only the records the user has access to are returned. Keeps things simple and secure.
CY
Cyndy
1 year ago
Option C sounds like the way to go. Using the userInfo class to filter the SOQL queries ensures that only the records the user has access to are returned. Keeps things simple and secure.
HA
Han
1 year ago
C) Use the userInfo Apex class to filter all SOQL queries to returned records owned by the logged-in user.
AL
Alyce
1 year ago
B) Use the without sharing keyword on the class declaration.
ES
Estrella
1 year ago
A) Use the with sharing keyword on the class declaration.
BU
Bulah
1 year ago
Option C sounds like the way to go. Using the userInfo class to filter the SOQL queries ensures that only the records the user has access to are returned. Keeps things simple and secure.
RH
Rhea
1 year ago
C) Use the userInfo Apex class to filter all SOQL queries to returned records owned by the logged-in user.
DA
Dallas
1 year ago
B) Use the without sharing keyword on the class declaration.
MA
Maira
1 year ago
A) Use the with sharing keyword on the class declaration.
YV
Yvonne
2 years ago
I'm not sure, but I think using the userInfo Apex class to filter SOQL queries could also work to ensure the user only sees their own accounts.
CO
Cordelia
2 years ago
I agree with Chandra. Using with sharing will enforce sharing permissions for the currently logged in user.
CH
Chandra
2 years ago
I think the developer should use the with sharing keyword on the class declaration.