Hi Paolo,
I don't think what you're after is possible without constructing an Add-In.
First off, let's straighten out a couple of things.
The link is from the diagram type to the toolbox -- not the other way around. Several diagram types can utilize the same toolbox, but a diagram type can only specify one toolbox. So your surmise in the OP is correct.
When EA opens a diagram, it checks the type and uses that to look up which toolbox to open. The type consists of two parts, the base type (UML diagrams, plus a few additional EA-specific ones) and the customized type [my term].
The customized type is on the form MyMdgTech::MyDiagramType -- in other words, two different MDG Technologies can contain diagram definitions with the same name without any conflict, since EA always uses the fully-qualified name internally.
The only thing you can use to control which toolbox gets opened is the diagram type. You can't get EA to sometimes open one toolbox and sometimes another for the same diagram type.
Pinning toolboxes means they remain for all diagram types. You'd have to get users of each role to pin their respective toolboxes -- and if the toolbox is intended for some analysis role, why should it stay open when they open a sequence diagram?
The Common toolbox is a very special beast which is outside the regular rules. If you overrode that (don't know that you can, but if) in different ways in two MDG Technologies, that might work -- but you'd have the same relevance problem, plus two different MDG Technologies to mainpain.
I simply don't think you can implement role-based anything in MDG Technologies; it's a dimension they just don't have.
Add-Ins to the rescue.
You can create a very simple Add-In which responds to the EA_OnPostOpenDiagram event by checking the diagram's type and the user's role (which you can ascertain from the API by combining Repository.GetCurrentLoginUser(), Repository.GetAuthor() and Repository.ProjectRoles), and then calling Repository.ActivateToolbox().
Unless you get really fancy, this solution means the (three-way) association between a role, a diagram type and a toolbox gets hard-coded. Or you could write it into the description field of the roles if you like, depending on how tightly you intend to lock down your environment (if anyone can change it, they will -- especially if they're architects).
Either way, this approach should work. Mind you, I haven't tested it and it does become a race between EA and you in terms of opening the toolbox. It's a matter of who gets in last.
Cheers,
/Uffe