thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Business Platforms & EA · Intermediate

Sharing Keywords

Apex class declarations with sharing, without sharing and inherited sharing that control whether record sharing rules are enforced.

Definition

Apex runs in system mode, ignoring object and field permissions; sharing keywords only control record-level sharing. inherited sharing takes the sharing mode of the caller and defaults to with sharing when entry point. Classes with no keyword usually behave as without sharing unless called from a with sharing context.

Example

public with sharing class CaseController { }

Exam tip

Sharing keywords do not enforce CRUD or FLS; use USER_MODE or stripInaccessible for that.

Related terms