RBAC permission evaluator
Your task
Implement an RBAC permission evaluator. A user holds a list of roles; role_permissions maps each role name to a list of permission strings it grants. Given the user's roles, the role-permission map, and a required permission, return True if ANY of the user's roles grants the required permission. Unknown roles (not present in the map) grant nothing. A user with no roles is granted nothing.
Examples
has_permission(roles: list[str], role_permissions: dict, required: str) -> boolExample 1
Input
has_permission(["admin"], {"admin": ["read", "write", "delete"], "editor": ["read", "write"], "viewer": ["read"]}, "delete")Output
True