{"id":1592,"date":"2026-09-09T11:00:00","date_gmt":"2026-09-09T05:30:00","guid":{"rendered":"https:\/\/swapnilzambare.com\/blog\/apex-crud-and-fls-user-mode\/"},"modified":"2026-09-09T11:00:00","modified_gmt":"2026-09-09T05:30:00","slug":"apex-crud-and-fls-user-mode","status":"publish","type":"post","link":"https:\/\/swapnilzambare.com\/blog\/apex-crud-and-fls-user-mode\/","title":{"rendered":"Apex CRUD and FLS: USER_MODE, SYSTEM_MODE and stripInaccessible"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Apex CRUD and FLS checks make sure your code respects what a user may do with an object and which fields they may see or edit. CRUD means create, read, update and delete permissions on an object. FLS means field-level security. Sharing keywords decide which records a user can reach, and CRUD and FLS decide what they can do with those records.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this post, you will learn user mode and system mode, the WITH USER_MODE clause, Security.stripInaccessible and describe checks. You will also see how the default changed in API version 67.0. It builds on <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-sharing-keywords-with-without-inherited\/\">Apex sharing keywords<\/a>, <a href=\"https:\/\/swapnilzambare.com\/blog\/profiles-and-permission-sets-salesforce\/\">profiles and permission sets<\/a> and <a href=\"https:\/\/swapnilzambare.com\/blog\/dynamic-soql-in-apex-injection\/\">dynamic SOQL in Apex<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is Apex CRUD and FLS?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Apex CRUD and FLS enforcement means your code checks the running user&#8217;s object and field permissions before it reads or changes data. Admins set these permissions in profiles and permission sets. If code ignores them, a user could see a salary field through a Lightning component even though the page layout hides it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Think of a hotel key card. Sharing decides which rooms your card opens. CRUD decides whether you may enter, clean or empty a room. FLS decides which drawers inside the room you may open. A secure app checks all three.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Apex CRUD and FLS Matters<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Hidden fields are not secure fields. Here is why Apex CRUD and FLS matters at Bright Path Tutors.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, tutors must not read Instructor_Pay__c, even through custom components.<\/li>\n\n<li>Also, support agents may view courses but must not change Fee__c.<\/li>\n\n<li>Next, Experience Cloud students must only see public course fields.<\/li>\n\n<li>AppExchange security review fails code that skips these checks.<\/li>\n\n<li>Finally, a single unprotected @AuraEnabled method can expose a whole object.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">So every query and DML that users can trigger needs Apex CRUD and FLS protection.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How Apex CRUD and FLS Checks Work<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Apex CRUD and FLS checks happen through the access mode of each database operation. First, Salesforce decides whether the operation runs in user mode or system mode. Next, in user mode, it checks the user&#8217;s object permission for the query or DML. Then it checks field-level security for every field used. After that, it applies the user&#8217;s sharing to choose records. Finally, if any check fails, Salesforce throws an exception instead of returning or saving data.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-crud-and-fls-user-mode-diagram-1-1024x640.png\" alt=\"Apex CRUD and FLS diagram showing access mode, object check, field check, sharing, pass and fail\" class=\"wp-image-1590\" srcset=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-crud-and-fls-user-mode-diagram-1-1024x640.png 1024w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-crud-and-fls-user-mode-diagram-1-300x188.png 300w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-crud-and-fls-user-mode-diagram-1-768x480.png 768w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-crud-and-fls-user-mode-diagram-1-1536x960.png 1536w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-crud-and-fls-user-mode-diagram-1-2048x1280.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">How user mode checks object, field and record access.<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">User Mode<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">User mode applies the running user&#8217;s CRUD, FLS and sharing. In API version 67.0 and later, it is the default for SOQL, SOSL and DML. You can also write it explicitly with WITH USER_MODE, <code>insert as user<\/code> or AccessLevel.USER_MODE.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">System Mode<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">System mode ignores CRUD and FLS, and record access then follows the class&#8217;s sharing keyword. In API 66.0 and earlier, it was the default. Now you must ask for it with WITH SYSTEM_MODE, <code>update as system<\/code> or AccessLevel.SYSTEM_MODE.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Security.stripInaccessible<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Security.stripInaccessible removes fields the user cannot access from a list of records, instead of throwing an exception. Use it when you want a partial result, such as showing a course without its hidden pay field.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Describe Checks<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Describe methods, such as <code>Schema.sObjectType.Course__c.isUpdateable()<\/code>, let you check permissions yourself. They are handy for hiding a button or skipping optional logic.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">WITH SECURITY_ENFORCED<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">WITH SECURITY_ENFORCED is an older query clause that only checks reads. Salesforce now recommends WITH USER_MODE, because it also covers sharing, DML and more query types.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Ways to Enforce Apex CRUD and FLS<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The table below lists the tools and when each fits.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Tool<\/th><th>Checks<\/th><th>On failure<\/th><\/tr><\/thead><tbody><tr><td>WITH USER_MODE in SOQL<\/td><td>CRUD, FLS, sharing<\/td><td>QueryException<\/td><\/tr><tr><td>insert as user<\/td><td>CRUD, FLS, sharing<\/td><td>DmlException<\/td><\/tr><tr><td>AccessLevel.USER_MODE<\/td><td>CRUD, FLS, sharing<\/td><td>Exception<\/td><\/tr><tr><td>Security.stripInaccessible<\/td><td>CRUD and FLS<\/td><td>Removes fields<\/td><\/tr><tr><td>Describe methods<\/td><td>What you ask for<\/td><td>Your own logic<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">User Mode vs System Mode<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The table below compares the two access modes.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Feature<\/th><th>User mode<\/th><th>System mode<\/th><\/tr><\/thead><tbody><tr><td>Object permissions<\/td><td>Enforced<\/td><td>Ignored<\/td><\/tr><tr><td>Field-level security<\/td><td>Enforced<\/td><td>Ignored<\/td><\/tr><tr><td>Record sharing<\/td><td>User&#8217;s sharing<\/td><td>Class keyword decides<\/td><\/tr><tr><td>Default since API 67.0<\/td><td>Yes<\/td><td>No, must be explicit<\/td><\/tr><tr><td>Best for<\/td><td>User-facing code<\/td><td>Trusted system jobs<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">When to use which is clear. Use user mode for anything a user triggers. Use system mode only for narrow, reviewed logic, such as a nightly recalculation, and say so in the code.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-crud-and-fls-user-mode-diagram-2-1024x640.png\" alt=\"Apex CRUD and FLS diagram comparing user mode and system mode\" class=\"wp-image-1591\" srcset=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-crud-and-fls-user-mode-diagram-2-1024x640.png 1024w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-crud-and-fls-user-mode-diagram-2-300x188.png 300w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-crud-and-fls-user-mode-diagram-2-768x480.png 768w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-crud-and-fls-user-mode-diagram-2-1536x960.png 1536w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-crud-and-fls-user-mode-diagram-2-2048x1280.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">User mode vs system mode.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">A Real Apex CRUD and FLS Example<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s protect Course__c data at Bright Path Tutors with Apex CRUD and FLS checks. Tutors cannot read Instructor_Pay__c, and only managers can edit Fee__c.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Query in User Mode<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>public with sharing class CourseController {\n\n    @AuraEnabled(cacheable=true)\n    public static List&lt;Course__c&gt; getCourses() {\n        return [SELECT Id, Name, Fee__c, Instructor_Pay__c\n                FROM Course__c\n                WITH USER_MODE\n                ORDER BY Name];\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The query asks for Instructor_Pay__c. In user mode, a tutor without read access to that field gets a QueryException, so no pay data leaks. In API 67.0 and later, the query would run in user mode even without the clause, but writing it makes the intent clear.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Strip Hidden Fields Instead<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>@AuraEnabled(cacheable=true)\npublic static List&lt;Course__c&gt; getCoursesSafe() {\n    List&lt;Course__c&gt; rows = [SELECT Id, Name, Fee__c, Instructor_Pay__c\n                            FROM Course__c WITH SYSTEM_MODE];\n    SObjectAccessDecision decision =\n        Security.stripInaccessible(AccessType.READABLE, rows);\n    System.debug('Removed: ' + decision.getRemovedFields());\n    return (List&lt;Course__c&gt;) decision.getRecords();\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The query runs in system mode, then stripInaccessible removes any field the user cannot read. So tutors get the courses without the pay field, and managers get everything. getRemovedFields shows which fields were stripped.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Save Only What the User May Edit<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>@AuraEnabled\npublic static void saveFee(Id courseId, Decimal newFee) {\n    if (!Schema.sObjectType.Course__c.fields.Fee__c.isUpdateable()) {\n        throw new AuraHandledException('You cannot change course fees.');\n    }\n    update as user new Course__c(Id = courseId, Fee__c = newFee);\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The describe check gives a friendly message early. Then <code>update as user<\/code> enforces CRUD, FLS and sharing again at save time. So even if someone skips the check, the update still fails safely.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: See the Results<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Here is what Asha Mehta, a tutor, gets in the debug log.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>getCourses()      -&gt; QueryException (Instructor_Pay__c is not accessible)\ngetCoursesSafe()  -&gt; Removed: {Course__c={Instructor_Pay__c}}\nsaveFee(...)      -&gt; AuraHandledException: You cannot change course fees.<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Each method protects the data in its own way. In real code, pick one style per method and stay consistent.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Apex CRUD and FLS for Older Code<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Classes saved at API 66.0 or earlier still run in system mode by default. So when you edit an old class, either raise its API version and test it, or add WITH USER_MODE and <code>as user<\/code> to every operation users can reach.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common Mistakes with Apex CRUD and FLS<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Thinking with sharing also checks object and field permissions.<\/li>\n\n<li>Relying on page layouts to hide sensitive fields.<\/li>\n\n<li>Using system mode in @AuraEnabled methods without a clear reason.<\/li>\n\n<li>Raising a class to a new API version without retesting permission errors.<\/li>\n\n<li>Ignoring the fields that stripInaccessible removed.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Best Practices for Apex CRUD and FLS<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Write an explicit access mode on every query and DML.<\/li>\n\n<li>Use user mode for anything a user can trigger.<\/li>\n\n<li>Use stripInaccessible when a partial result is better than an error.<\/li>\n\n<li>Add describe checks for friendly messages and hidden buttons.<\/li>\n\n<li>Test with a restricted permission set inside System.runAs.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Practice Task<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Create a permission set that gives read access to Course__c but not Fee__c. Then write a test that runs getCoursesSafe inside System.runAs and asserts that Fee__c is not populated. Hint: use <code>isSet('Fee__c')<\/code> on the returned record.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Most Asked Interview Questions on Apex CRUD and FLS<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Security questions are now standard in developer interviews. Here are the 21 questions asked most about Apex CRUD and FLS.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Basic Questions on Apex CRUD and FLS<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q1: What do CRUD and FLS mean?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">CRUD is create, read, update and delete permission on an object. FLS is field-level security on each field.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q2: Do sharing keywords enforce CRUD and FLS?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">No. They control record access only.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q3: What is user mode?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An access mode that applies the user&#8217;s CRUD, FLS and sharing to a database operation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q4: What is system mode?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An access mode that ignores CRUD and FLS, with record access decided by the class keyword.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q5: What is the default mode in API 67.0 and later?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">User mode.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q6: How do you run a query in user mode?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add WITH USER_MODE to the SOQL query.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q7: How do you run DML in user mode?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use <code>insert as user<\/code>, <code>update as user<\/code>, or a Database method with AccessLevel.USER_MODE.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Code and Scenario Questions on Apex CRUD and FLS<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q8: What does Security.stripInaccessible return?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An SObjectAccessDecision with the cleaned records and the removed fields.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q9: Which AccessType values does stripInaccessible support?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">READABLE, CREATABLE, UPDATABLE and UPSERTABLE.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q10: What happens when a user-mode query includes a hidden field?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It throws a QueryException.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q11: How do you check if a user can edit a field?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Call isUpdateable on the field describe, such as Schema.sObjectType.Course__c.fields.Fee__c.isUpdateable().<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q12: How do you run dynamic SOQL in user mode?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Pass AccessLevel.USER_MODE to Database.query or Database.queryWithBinds.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q13: When would you choose stripInaccessible over user mode?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When you want to return the record without hidden fields instead of failing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q14: How do you test FLS in Apex?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create a user with a restricted permission set and run the code inside System.runAs.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Advanced Questions on Apex CRUD and FLS<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q15: Why is WITH USER_MODE preferred over WITH SECURITY_ENFORCED?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It also enforces sharing, supports more query types and works with DML through matching options.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q16: What should you check when raising an old class to API 67.0?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That its queries and DML still work in user mode for every user who runs them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q17: Can stripInaccessible protect data from JSON input?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. It can sanitize records deserialized from untrusted input before DML.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q18: Do Automated Process users pass CRUD and FLS checks?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Not by default. They need permission sets assigned for object and field checks to pass.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q19: How do object permissions and sharing interact?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Object and field permissions take precedence. Sharing cannot grant access the user&#8217;s permissions deny.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q20: When is system mode acceptable?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For trusted system processes, such as recalculations or integrations, with a clear comment and review.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q21: How do you find code that skips CRUD and FLS?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run Salesforce Code Analyzer, which flags violations such as ApexCRUDViolation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Official Resources<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/developer.salesforce.com\/docs\/platform\/apex-dev\/references\/apex-dev\/apex-classes-perms-enforcing.html\" target=\"_blank\" rel=\"noopener noreferrer\">Enforce Object and Field Permissions (Apex Developer Guide)<\/a><\/li>\n\n<li><a href=\"https:\/\/developer.salesforce.com\/docs\/platform\/apex-dev\/references\/apex-dev\/apex-classes-enforce-usermode.html\" target=\"_blank\" rel=\"noopener noreferrer\">Set an Access Mode for Database Operations (Apex Developer Guide)<\/a><\/li>\n\n<li><a href=\"https:\/\/developer.salesforce.com\/docs\/platform\/apex-dev\/references\/apex-dev\/apex-classes-with-security-stripinaccessible.html\" target=\"_blank\" rel=\"noopener noreferrer\">Enforce Security with the stripInaccessible Method (Apex Developer Guide)<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Quick Recap<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Apex CRUD and FLS checks protect objects and fields, not records.<\/li>\n\n<li>User mode enforces CRUD, FLS and sharing, and is the default since API 67.0.<\/li>\n\n<li>System mode must now be explicit and should stay rare.<\/li>\n\n<li>stripInaccessible removes hidden fields instead of throwing errors.<\/li>\n\n<li>Describe checks help with friendly messages and UI decisions.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">What&#8217;s Next?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Sometimes you must share records through code. Next, read our guide to <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-managed-sharing-share-records\/\">Apex managed sharing<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apex CRUD and FLS checks make sure your code respects what a user may do with an object and which fields they may see&hellip;<\/p>\n","protected":false},"author":1,"featured_media":1589,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_swapz_level":"","_swapz_series_part":0,"_swapz_hide_toc":false,"_swapz_hide_featured":false,"_swapz_description":"","footnotes":""},"categories":[8,96],"tags":[98,26,91,7,97,17],"swapz_series":[],"class_list":["post-1592","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-salesforce","category-salesforce-developer","tag-apex","tag-intermediate","tag-interview-questions","tag-salesforce","tag-salesforce-developer","tag-security"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Apex CRUD and FLS: USER_MODE and stripInaccessible<\/title>\n<meta name=\"description\" content=\"Apex CRUD and FLS explained simply: user mode, system mode, WITH USER_MODE, stripInaccessible, describe checks, API 67 changes and 21 interview Q&amp;A.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/swapnilzambare.com\/blog\/apex-crud-and-fls-user-mode\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apex CRUD and FLS: USER_MODE and stripInaccessible\" \/>\n<meta property=\"og:description\" content=\"Apex CRUD and FLS explained simply: user mode, system mode, WITH USER_MODE, stripInaccessible, describe checks, API 67 changes and 21 interview Q&amp;A.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/swapnilzambare.com\/blog\/apex-crud-and-fls-user-mode\/\" \/>\n<meta property=\"og:site_name\" content=\"Swapnil Zambare - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-09T05:30:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-crud-and-fls-user-mode-featured.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2400\" \/>\n\t<meta property=\"og:image:height\" content=\"1260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Swapnil Zambare\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Swapnil Zambare\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-crud-and-fls-user-mode\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-crud-and-fls-user-mode\\\/\"},\"author\":{\"name\":\"Swapnil Zambare\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/person\\\/922ac0131aaa7088c78c2cb1700e0c9a\"},\"headline\":\"Apex CRUD and FLS: USER_MODE, SYSTEM_MODE and stripInaccessible\",\"datePublished\":\"2026-09-09T05:30:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-crud-and-fls-user-mode\\\/\"},\"wordCount\":1701,\"publisher\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-crud-and-fls-user-mode\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/apex-crud-and-fls-user-mode-featured.png\",\"keywords\":[\"Apex\",\"Intermediate\",\"Interview Questions\",\"Salesforce\",\"Salesforce Developer\",\"Security\"],\"articleSection\":[\"Salesforce\",\"Salesforce Developer\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-crud-and-fls-user-mode\\\/\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-crud-and-fls-user-mode\\\/\",\"name\":\"Apex CRUD and FLS: USER_MODE and stripInaccessible\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-crud-and-fls-user-mode\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-crud-and-fls-user-mode\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/apex-crud-and-fls-user-mode-featured.png\",\"datePublished\":\"2026-09-09T05:30:00+00:00\",\"description\":\"Apex CRUD and FLS explained simply: user mode, system mode, WITH USER_MODE, stripInaccessible, describe checks, API 67 changes and 21 interview Q&A.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-crud-and-fls-user-mode\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-crud-and-fls-user-mode\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-crud-and-fls-user-mode\\\/#primaryimage\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/apex-crud-and-fls-user-mode-featured.png\",\"contentUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/apex-crud-and-fls-user-mode-featured.png\",\"width\":2400,\"height\":1260,\"caption\":\"Apex CRUD and FLS featured image: title card with an Apex code example\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-crud-and-fls-user-mode\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Apex CRUD and FLS: USER_MODE, SYSTEM_MODE and stripInaccessible\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\",\"name\":\"Swapnil Zambare - Blog\",\"description\":\"Salesforce &amp; Tech Guides\",\"publisher\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\",\"name\":\"Swapnil Zambare - Blog\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/site-icon-512.png\",\"contentUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/site-icon-512.png\",\"width\":512,\"height\":512,\"caption\":\"Swapnil Zambare - Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/theSwapnilZambare\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/person\\\/922ac0131aaa7088c78c2cb1700e0c9a\",\"name\":\"Swapnil Zambare\",\"sameAs\":[\"https:\\\/\\\/swapnilzambare.com\\\/blog\"],\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/author\\\/swapnil-zambare\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Apex CRUD and FLS: USER_MODE and stripInaccessible","description":"Apex CRUD and FLS explained simply: user mode, system mode, WITH USER_MODE, stripInaccessible, describe checks, API 67 changes and 21 interview Q&A.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/swapnilzambare.com\/blog\/apex-crud-and-fls-user-mode\/","og_locale":"en_US","og_type":"article","og_title":"Apex CRUD and FLS: USER_MODE and stripInaccessible","og_description":"Apex CRUD and FLS explained simply: user mode, system mode, WITH USER_MODE, stripInaccessible, describe checks, API 67 changes and 21 interview Q&A.","og_url":"https:\/\/swapnilzambare.com\/blog\/apex-crud-and-fls-user-mode\/","og_site_name":"Swapnil Zambare - Blog","article_published_time":"2026-09-09T05:30:00+00:00","og_image":[{"width":2400,"height":1260,"url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-crud-and-fls-user-mode-featured.png","type":"image\/png"}],"author":"Swapnil Zambare","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Swapnil Zambare","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/swapnilzambare.com\/blog\/apex-crud-and-fls-user-mode\/#article","isPartOf":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-crud-and-fls-user-mode\/"},"author":{"name":"Swapnil Zambare","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/person\/922ac0131aaa7088c78c2cb1700e0c9a"},"headline":"Apex CRUD and FLS: USER_MODE, SYSTEM_MODE and stripInaccessible","datePublished":"2026-09-09T05:30:00+00:00","mainEntityOfPage":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-crud-and-fls-user-mode\/"},"wordCount":1701,"publisher":{"@id":"https:\/\/swapnilzambare.com\/blog\/#organization"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-crud-and-fls-user-mode\/#primaryimage"},"thumbnailUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-crud-and-fls-user-mode-featured.png","keywords":["Apex","Intermediate","Interview Questions","Salesforce","Salesforce Developer","Security"],"articleSection":["Salesforce","Salesforce Developer"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/swapnilzambare.com\/blog\/apex-crud-and-fls-user-mode\/","url":"https:\/\/swapnilzambare.com\/blog\/apex-crud-and-fls-user-mode\/","name":"Apex CRUD and FLS: USER_MODE and stripInaccessible","isPartOf":{"@id":"https:\/\/swapnilzambare.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-crud-and-fls-user-mode\/#primaryimage"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-crud-and-fls-user-mode\/#primaryimage"},"thumbnailUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-crud-and-fls-user-mode-featured.png","datePublished":"2026-09-09T05:30:00+00:00","description":"Apex CRUD and FLS explained simply: user mode, system mode, WITH USER_MODE, stripInaccessible, describe checks, API 67 changes and 21 interview Q&A.","breadcrumb":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-crud-and-fls-user-mode\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/swapnilzambare.com\/blog\/apex-crud-and-fls-user-mode\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/swapnilzambare.com\/blog\/apex-crud-and-fls-user-mode\/#primaryimage","url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-crud-and-fls-user-mode-featured.png","contentUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-crud-and-fls-user-mode-featured.png","width":2400,"height":1260,"caption":"Apex CRUD and FLS featured image: title card with an Apex code example"},{"@type":"BreadcrumbList","@id":"https:\/\/swapnilzambare.com\/blog\/apex-crud-and-fls-user-mode\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/swapnilzambare.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Apex CRUD and FLS: USER_MODE, SYSTEM_MODE and stripInaccessible"}]},{"@type":"WebSite","@id":"https:\/\/swapnilzambare.com\/blog\/#website","url":"https:\/\/swapnilzambare.com\/blog\/","name":"Swapnil Zambare - Blog","description":"Salesforce &amp; Tech Guides","publisher":{"@id":"https:\/\/swapnilzambare.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/swapnilzambare.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/swapnilzambare.com\/blog\/#organization","name":"Swapnil Zambare - Blog","url":"https:\/\/swapnilzambare.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/09\/site-icon-512.png","contentUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/09\/site-icon-512.png","width":512,"height":512,"caption":"Swapnil Zambare - Blog"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.linkedin.com\/in\/theSwapnilZambare"]},{"@type":"Person","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/person\/922ac0131aaa7088c78c2cb1700e0c9a","name":"Swapnil Zambare","sameAs":["https:\/\/swapnilzambare.com\/blog"],"url":"https:\/\/swapnilzambare.com\/blog\/author\/swapnil-zambare\/"}]}},"_links":{"self":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/1592","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/comments?post=1592"}],"version-history":[{"count":0,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/1592\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/media\/1589"}],"wp:attachment":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/media?parent=1592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/categories?post=1592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/tags?post=1592"},{"taxonomy":"swapz_series","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/swapz_series?post=1592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}