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
Post a Comment