I don't entirely understand what you are asking for.
I think you are asking for something different from our plugin https://moodle.org/plugins/tool_editrolesbycap - but I just thought I would mention it in case it helps.
I think you are asking for something different from our plugin https://moodle.org/plugins/tool_editrolesbycap - but I just thought I would mention it in case it helps.