I would want to remove edit/delete permissions on activity records (Lead, Account, Contact and Opportunities) for regular users. Only system administrators are to be provided with these permissions. How could I achieve this scenario.
3 Answers
I did figure it out and I have used rendered="{!if($Profile.Name == 'System Administrator',true,false)}" which eventually worked by only allowing System Administrators to have the edit/delete functionalities
You can't restrict access to Activities (Tasks and Events) at an object level (profile). However, you can control record level permissions with sharing settings. Most Salesforce instances have activities sharing settings set to "Controlled by Parent" so the parent record associated with the activity controls who has access to edit the record based on the sharing settings for that parent object. You can however make Activities completely private and create sharing rules or manage sharing with apex.
You could write a before update/delete trigger on Activity to achieve this.
Check for the profile and then decide to allow the edit or delete. If its not the System admin then throw an error in your trigger.