• Get Review Board
  • What's New
  • Products
  • Review Board Code review, image review, and document review
  • Documentation
  • Release Notes
  • Power Pack Enterprise integrations, reports, and enhanced document review
  • Try for 60 Days
  • Purchase
  • RBCommons Review Board as a Service, hosted by us
  • Pricing
  • RBTools Command line tools and Python API for Review Board
  • Documentation
  • Release Notes
  • Review Bot Automated code review, connecting tools you already use
  • Documentation
  • Release Notes
  • RB Gateway Manage Git and Mercurial repositories in your network
  • Documentation
  • Release Notes
  • Learn and Explore
  • What is Code Review?
  • Documentation
  • Frequently Asked Questions
  • Support Options
  • Third-Party Integrations
  • Demo
  • Review Board RBTools Power Pack Review Bot Djblets RB Gateway
    1. Power Pack
    2. Public Codebase Reference
  • Home
  • Installation
  • Licenses
  • Managing Licensed Users
  • Features
  • Document Review
  • Setting Up Review for Office Documents
  • Reports
  • Repositories
  • AWS CodeCommit Support
  • Bitbucket Data Center Support
  • ClearCase Repositories
  • Keysight SOS Support
  • GitHub Enterprise Support
  • Azure DevOps Server / Team Foundation Server Support
  • Azure DevOps Services Support
  • Server Management
  • Database Import and Export
  • Distributed SSH Keys
  • Automating with Management Commands
  • Public Codebase Reference
  • General Index
  • Release Notes
  • Public Codebase Reference¶

    This documents the public classes and methods that may be useful to extension authors who integrate with Power Pack features.

    User Roles¶

    UserRoleManager.for_user(user: User, *, local_site: LocalSite | None = None, request: HttpRequest | None = None) → Sequence[UserRole]¶

    Return all User Roles for a given user.

    This is designed to be efficient, utilizing the memory cache backend and a local request-bound memory cache to make repeated calls inexpensive.

    In an optimal case (< 10,000 user associations), this can fetch the user roles for any user in one SQL query. For larger deployments, user and role mappings will be computed as needed and cached within the lifespan of the request.

    The resulting list of User Roles will be sorted in role name order.

    Callers are expected to check that the user is an active member of the Local Site before calling this method.

    Parameters:
    • user (django.contrib.auth.models.User) – The user for which to return User Roles.

    • local_site (reviewboard.site.models.LocalSite, optional) – The Local Site the User Roles should be associated with.

    • request (django.http.HttpRequest, optional) – The current HTTP request from the client to use for local caching.

    Returns:

    The list of User Roles for the user.

    Return type:

    list of rbpowerpack.roles.models.UserRole

    Keep up with the latest Review Board releases, security updates, and helpful information.

    About
    News
    Demo
    RBCommons Hosting
    Integrations
    Happy Users
    Support Options
    Documentation
    FAQ
    User Manual
    RBTools
    Administration Guide
    Power Pack
    Release Notes
    Downloads
    Review Board
    RBTools
    Djblets
    Power Pack
    Package Store
    PGP Signatures
    Contributing
    Bug Tracker
    Submit Patches
    Development Setup
    Wiki
    Follow Us
    Mailing Lists
    Reddit
    Twitter
    Mastodon
    Facebook
    YouTube
    Copyright © 2006-2026 Beanbag, Inc. All rights reserved.
    Terms of Service — Privacy Policy — AI Ethics Policy — Branding

    On this page

    • [Top]
    • User Roles
      • UserRoleManager.for_user()