Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #440 - changes the few tests that are exercising CRUD/FLS enforcement to prefer the 'Minimum Access - Salesforce' profile since that is a more reliable Profile in most modern orgs #482

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

daveespo
Copy link
Contributor

@daveespo daveespo commented Feb 22, 2024

My first cut at fixing this bug was to try to find an SObject that the Read Only profile DIDN'T grant Read access to. Well, that was a fool's errand because even though there were some Standard Objects that didn't have Object Read access, the FLS on the object granted Read access to every field on those Standard Objects.

I backed away from trying to find a way to thread that needle and instead applied a bit more of a pragmatic approach. Rather than preferring the 'Read Only' profile and if it doesn't exist, create a Minimum Access user and assign them a well-known set of Perms via a Perm Set, let's just start with that (i.e. always prefer the Minimum Access user)

There are potential regressions here for orgs that don't have the Minimum Access profile which does exist out in the wild. Those orgs will fall back to the 'Read Only' profile .. and it's likely that the same tests that are broken as reported in #440 will continue to be broken. But at least this patch fixes the more common case of people not being able to get a clean test run if they create a brand spanking new Developer Edition org (not scratch org)

I tested this on a clean DE org and on a Scratch Org of edition Developer -- tests pass cleanly in both (and prior to this fix, the tests failed as outlined in #440 in the DE org)


This change is Reviewable

…cement to prefer the 'Minimum Access - Salesforce' profile since that is a more reliable Profile in most modern orgs
@ImJohnMDaniel ImJohnMDaniel merged commit 41f92e9 into master Feb 27, 2024
2 of 3 checks passed
@ImJohnMDaniel ImJohnMDaniel deleted the 440-prefer-minimum-access-over-read-only branch February 27, 2024 04:42
@foxysolutions
Copy link
Contributor

Thanks for the effort and solution @daveespo , looking good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants