RBAC in Mercurial is a security framework that defines who can do what across repositories, branches, and operations. Permissions are tied to roles. Roles are assigned to users or automation accounts. This means access is managed from a central ruleset instead of scattered configuration files. The design keeps enforcement consistent and auditable.
In Mercurial RBAC, rules control push, pull, commit, merge, tag, and repository creation. A role can allow or deny each action on specific projects or branches. This level of granularity prevents unapproved code changes, limits risk, and protects sensitive work. Enforcement happens at the server layer, so even local tricks cannot bypass it.
Rules are composed with clarity. For example, a “Maintainer” role can merge to main and manage tags, but cannot rewrite published history. A “Developer” role can commit and push to feature branches, but only submit changes to main through pull requests. By grouping permissions into clear roles, admins can modify access quickly without rewriting complex policy files.