I have a custom mainview and I need to limit access to the the underlying table. Some records are to be accessible by all users, and others are to only be accessible by our HR team, a specific sales rep, and the rep’s manager. Can I limit access to records using code?
To reiterate, here are the access levels that are needed:
-Everyone – accessible by everyone
-Exclusive – accessible by HR Dept, Sales Rep, Sales Manager
I would like to create these through code , so that they are created correctly and members are assigned correctly.
I don’t see really a need to dynamically create profiles based on this description.
Records accessible to all users should be owned by the “Everyone” team.
Restricted records would be owned by the Sales Rep. Because you have granted the HR dept and the Rep’s manager to hi default security profile, this accomplishes the requirement for the “Exclusive” rule.