Programatic Sharing Flashcards Preview

SFDC Sharing and Visibility Designer > Programatic Sharing > Flashcards

Flashcards in Programatic Sharing Deck (10)
Loading flashcards...
1

Which object do you use when you share a record using Apex?

Use the share object associated with the standard or custom object for which you want to share (Naming convention is the name of the object appended with __Share

2

Which object in a master-detail relationship do not have an associated sharing object?

The object on the detail side of a master-detail relationship. The detail record's access is determined by the master's sharing object and the relationship's sharing setting

3

What are the 3 sharing types supported on a share object?

Managed sharing

User Managed Sharing

Apex Managed Sharing

4

Which users can add or change Apex managed sharing on a record?

Only users with "Modify All Data"

5

How do you go about creating Apex Managed Sharing for Customer Community Plus users?

Share objects aren't available to Customer Community Plus users. Consider using a trigger, which operates with the without sharing keyword by default. Otherwise, use an inner class with the same keyword to enable the DML operation to run successfully. A separate utility class can also be used to enable this access

6

Is it possible to manually share a record to a user or a group using Apex or the SOAP API?

Yes, but if the owner of the record changes, the sharing is automatically deleted.

7

When the ownership of a record change, any manual shares will be remove. How can you prevent your programmatic shares from being removed as well

Use Apex Sharing Reasons for the row cause (instead of the 'manual' one)

8

What does the runAs method enforce?
A. User permissions
B. Field-Level Permissions
C. Record Sharing

C. Record Sharing

9

When /where can you use the runAs method?

Only in test methods.

10

Does the runAs method use up a user license?

The runAs method ignores user license limits. You can create new users with runAs even if your organization has no additional user licenses.