Jump to >

reviewboard.site.models

class LocalSite(*args, **kwargs)[source]

Bases: django.db.models.base.Model

A division within a Review Board installation.

This allows the creation of independent, isolated divisions within a given server. Users can be designated as members of a LocalSite, and optionally as admins (which allows them to manipulate the repositories, groups and users in the site).

Pretty much every other model in this module can all be assigned to a single LocalSite, at which point only members will be able to see or manipulate these objects. Access control is performed at every level, and consistency is enforced through a liberal sprinkling of assertions and unit tests.

users[source]
admins[source]
is_accessible_by(user)[source]

Returns whether or not the user has access to this LocalSite.

This checks that the user is logged in, and that they’re listed in the ‘users’ field.

is_mutable_by(user, perm=u'site.change_localsite')[source]

Returns whether or not a user can modify settings in a LocalSite.

This checks that the user is either staff with the proper permissions, or that they’re listed in the ‘admins’ field.

By default, this is checking whether the LocalSite itself can be modified, but a different permission can be passed to check for another object.

__str__()[source]
__unicode__()[source]
default_reviewers[source]
file_attachments[source]
get_extra_data_json()[source]
groups[source]
hosting_service_accounts[source]
integration_configs[source]
oauth_applications[source]
objects = <django.db.models.manager.Manager object>[source]
repository_set[source]
review_requests[source]
set_extra_data_json(json)[source]
site_profiles[source]
trophies[source]
webapi_tokens[source]
webhooks[source]