Field Level Security In Salesforce
What is Field level security (FLS)?
At object level security we define permission regarding operations which a user can do with Salesforce objects like user can read, create, edit, delete, view all & modify all. Object permissions you can give at object level. Now you want to restrict some sensitive fields of an object from the users as needed from the business, we can do this using field level security.
You can grant read & edit permissions to the field. Yor can manage these filed level permissions via three ways.
- From “set field level security” button at field level.
- From “view field accessibility” button at field level.
- In profiles or permission sets we can handle field level permissions.
How can we provide filed level security?
Now in Merchandise custom object you don’t want to display Merchandise Price filed for all profiles in salesforce organization. For some profiles you want give visible permission, for some profiles you don’t want to display this field and for some profiles you want to give both visible and edit permissions. So how many ways you can achieve this? You can achieve this via two ways first is from field and second one is from profile.
1. Managing Field level security at profile level
To handle Field permissions you need to go to profile of your choice and go to Field level security section and from there search for object e.g. Merchandise you want enable field permissions, click on view and edit and provide permissions for required fields and save.
Note: In profiles you can observe Field level security section on profile detail page. Always remember that you cannot find Field permission on profile edit page.
2. By using view field accessibility button.
Step 1. To view field accessibility: Setup > Administer > field accessibility
In Lightning Experience, Setup > Security >Field Accessibility
Step 2: Field accessibility page will be open as follows:-
Step 3: Click on any object like Account and below page will be opened where we can set field accessibility
Step 4: Click ‘View by Profiles’ and select ‘System Administrator’ from profile dropdown. Below screen will be available to user to modify field level security
Step 5: Click any field and below screen will be opened where you can modify Field permissions sand click ‘Save’.
Step 6: : Repeat step # 5 for all fields where we need to modify field permission