Skip to main content

Data Access Control

While using Apex class, built-in user permissions and field-level security, organisation wide defaults, etc restrictions are not respected during execution. This is even true for visual force.

To enforce the permissions, 'with sharing' keyword is used to share the permission settings:
public with sharing class example
{
.
.
}
with sharing directs the platform to use security sharing permissions of the user currently logged in, rather than granting full access to all records.
Similarly, without sharing is used to ignore the security sharing permissions of the user currently logged in.



Comments

Popular posts from this blog

Connected App

 A connected app is a framework that enables an external application to integrate with Salesforce using APIs and standard protocols, such as SAML, OAuth, and OpenID Connect. Connected apps use these protocols to authenticate, authorize, and provide single sign-on (SSO) for external apps. The external apps that are integrated with Salesforce can run on the customer success platform, other platforms, devices, or SaaS subscriptions. For example, when you log in to your Salesforce mobile app and see your data from your Salesforce org, you’re using a connected app. https://help.salesforce.com/articleView?id=sf.connected_app_overview.htm&type=5 By capturing metadata about an external app, a connected app tells Salesforce which protocol—SAML, OAuth, and OpenID Connect—the external app uses, and where the external app runs. Salesforce can then grant the external app access to its data, and attach policies that define access restrictions, such as when the app’s access expires. Salesforc...