Assigning a task can give access permissions if it's allowed in the project settings. Allowing just a role to grant access could be a confidentiality issue, especially if you have several confidential (new business, finance, HR, etc.) groups that contain a lot of roles.
I have since discovered that, even if the project settings are correct, assigning a role to a task does NOT provide access to the task.
I find this puzzling, given that one can manually 'share' the task and give the 'role' access. It seems users, teams and groups can all get access when assigned to a task... Why not a role... Why would you be able to assign a role and then not have the role able to do anything???
Maybe I'm missing something in the intended use of a role???
I should have clarified; assigning a task to a person gives access if it's allowed in the project settings. You can inherit permissions from a group or team you're on but not a role.
A role is really just a placeholder so the person assigning tasks knows what skill set that task requires. All tasks should ultimately be assigned to an actual person so that person knows they are responsible for that task.
I recommend reading more about job roles and their intended use HERE
I believe this idea of assigning a role is just mean to be a placeholder on a template, a guide for the planner to use. For one, if you click on that role after it is assigned it usually will pop-open a list of only users with that role for subsequent assignment (if I recall correctly).