function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Christopher Bahr 4Christopher Bahr 4 

How to set up permissions to only allow editing of Opportunities by Record Type and Role?

So basically we have opportunity record types and user roles set up by business lines. We want to restrict editing of the Opportunities to where the record type and roles matchup. We have the OWD for opportunities set to private and a sharing rule giving Read/Write access based on the opportunity record type and the role. I look at the sharing heirarchy and it shows read access and write access for the correct record types. However edit access seems to only be controlled by the user's profile. If their profile has Opportunity edit access set, they can edit all opportunties, if it's not set, they cannot edit any opportunties.
Is there a correct way to set this up? Is there anywhere else I can look at to see why this would be occuring?
Sukanya BanekarSukanya Banekar
To give edit access to the record, you have to setup object level access for editing either from the profile level or by creating a permission set with edit access to the Opportunity and Record Type.

If you only want specific users within the same profile to have edit access, you can create a permission set for them.

Thanks,
Sukanya Banekar
SwethaSwetha (Salesforce Developers) 
HI Christopher ,
To set up permissions to only allow editing of Opportunities by Record Type and Role in Salesforce, you can follow these steps:

> Create Record Types: Create record types for the Opportunities that you want to restrict editing access to. For example, you can create record types for different business lines.
> Create Roles: Create roles for the users who will be editing the Opportunities. Assign the roles based on the business line or other criteria that you want to use to restrict editing access.
> Set Object-Level Permissions: Set the object-level permissions for the Opportunity object to Private. This will ensure that users can only see the Opportunities that they own or have been granted access to.
> Create Sharing Rules: Create sharing rules to grant Read/Write access to Opportunities based on the record type and role. This will allow users with the appropriate role and record type to edit the Opportunities.
> Create Permission Sets: Create permission sets that include the appropriate record types and assign them to the roles that you created in step 2. This will ensure that users with the appropriate role and record type have the necessary permissions to edit the Opportunities.
>Assign Permission Sets: Assign the permission sets to the appropriate users based on their role and record type. This will give them the necessary permissions to edit the Opportunities.

By following these steps, you can set up permissions to only allow editing of Opportunities by Record Type and Role in Salesforce.

Related: 
https://salesforce.stackexchange.com/questions/247009/how-to-allow-edit-access-to-for-certain-record-types-only
https://www.salesforceben.com/salesforce-roles-profiles-permission-sets/
https://help.salesforce.com/s/articleView?id=sf.permissions_record_type_access.htm&type=5
https://help.salesforce.com/s/articleView?id=sf.perm_sets_record_types_assign.htm&type=5

If this information helps, please mark the answer as best. Thank you