Add site divisions within Review Board.

Review Request #1795 — Created Sept. 26, 2010 and submitted

Information

Review Board
master

Reviewers

Add site divisions within Review Board.

This change adds a new app within RB called "site", which will be used to divide
a single review board server with permissions barriers. At the moment, a
LocalSite has a name and a list of users who have access to that site.  This is
related to various objects via a foreign key. If that relation is null, the
given object is treated as being totally open. If not, the requesting user will
be checked against the users list.

The plan is to namespace our URLs such that most views can either be at the root
(for example, "/r/1/") or prefixed with the LocalSite name ("/site-name/r/1/").
If an object has a LocalSite set, it *must* be accessed via the URL with the
name. While many objects will have pks that are universally the same (comments,
for example), we want it to appear as if, for all intents and purposes, they
have their own reviewboard instance running in a rooted name.

The one special object as far as IDs go is ReviewRequest. This has both a pk and
a "local_id" field. The local_id is a special field which is unique among all
ReviewRequests that have the same local_site. This allows us to give the sites
their own ID namespaces, since people will be passing the IDs on the
command-line for post-review.

 
jan.koprowski
  1. Great job! I fill I will love this review. This will be cool to work on this and add relation between sites and groups also. But this is awesome even now! Thank You very much, really.
  2. 
      
KA
  1. 
      
  2. 
      
david
david
chipx86
  1. Awesome. Looking forward to this.
    
    A couple minor things.
  2. reviewboard/reviews/evolutions/localsite.py (Diff revision 3)
     
     
     
    Can condense to one line.
  3. reviewboard/site/admin.py (Diff revision 3)
     
     
    This isn't actually used. PyFlakes is going to yell about it :)
  4. reviewboard/site/models.py (Diff revision 3)
     
     
    Hmm... That's an important thing to figure out.
    1. I'm thinking another relation to User?
  5. 
      
david
chipx86
  1. Looks good.
  2. 
      
david
Review request changed
chipx86
  1. 
      
  2. reviewboard/site/models.py (Diff revisions 4 - 5)
     
     
     
     
     
    Align the parameters.
  3.