Can't use AccessControl anymore after release of 5.0?

You can use the _grantRole function instead. _setupRole was removed in 5.0 and was previously already marked as deprecated.

Note that 5.0 contains a number of breaking changes. Please see the release notes at if you encounter other similar errors.

The current recommended best practice is also to not use msg.sender for the role assignment, but to pass in addresses for the roles in the constructor arguments. See for an example.