Contents
Apex managed sharing enables developers to programmatically manipulate sharing to support their application’s behavior through Apex or the SOAP API. This type of sharing is similar to managed sharing. Only users with “Modify All Data” permission can add or change Apex managed sharing on a record.
What are the permissions for sharing in apex?
Sharing granted to users implicitly through organization-wide defaults, the role hierarchy, and permissions such as the “View All” and “Modify All” permissions for the given object, “View All Data,” and “Modify All Data” are not tracked with this object. Every share object has the following properties:
Under certain circumstances, inserting a share row results in an update of an existing share row. Consider these examples: A manual share access level is set to Read and you insert a new one set to Write. The original share rows are updated to Write, indicating the higher level of access.
How are custom object sharing objects named in apex?
In addition, all custom object sharing objects are named as follows, where MyCustomObject is the name of the custom object: “MyCustomObject__Share”. Objects on the detail side of a master-detail relationship do not have an associated sharing object.
How does a developer use apex managed sharing?
Administrators first set an object’s organization-wide default sharing access level, and then grant additional access based on record ownership, the role hierarchy, sharing rules, and manual sharing. Developers can then use Apex managed sharing to grant additional access programmatically with Apex.
How to create apex based sharing for standard objects?
As Apex Sharing Reason not available for Standard objects only way to create Apex based sharing for Standard objects are using row cause Manual As row cause is Manual for Standard objects, Apex based sharing would be lost once owner is changed [Because its behavior of Manual Sharing]
Which is the public read / write object in apex?
For custom objects, this is Public Read/Write. For more information, see Access Levels. This object is used for creating Apex based sharing. The user to which the record going to be shared must have the object level permission.