Allow Features to disable web API resources

Review Request #8470 - Created Oct. 17, 2016 and submitted

Barret Rennie
Review Board
release-3.0.x
8472
8471, 8477
bb2dddd...
reviewboard

Review Board web API resources now have a required_features attribute
which indicates which features must be enabled for the feature to be
available. If any of the listed features are disabled, the resource will
return a 403 Forbidden error for any of the resource's methods. When all
features are enabled, the resource will behave as normal.

Ran unit tests.

  • 0
  • 0
  • 16
  • 0
  • 16
Description From Last Updated
Review Bot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/base.py
        reviewboard/webapi/tests/test_base.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/base.py
        reviewboard/webapi/tests/test_base.py
    
    
  2. reviewboard/webapi/tests/test_base.py (Diff revision 1)
     
     
    Col: 1
     W391 blank line at end of file
    
  3. 
      
Barret Rennie
Review Bot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/base.py
        reviewboard/webapi/tests/test_base.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/base.py
        reviewboard/webapi/tests/test_base.py
    
    
  2. 
      
Barret Rennie
Barret Rennie
Review Bot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/base.py
        reviewboard/webapi/tests/test_base.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/base.py
        reviewboard/webapi/tests/test_base.py
    
    
  2. reviewboard/webapi/base.py (Diff revision 3)
     
     
     'Feature' imported but unused
    
  3. reviewboard/webapi/tests/test_base.py (Diff revision 3)
     
     
    Col: 21
     E126 continuation line over-indented for hanging indent
    
  4. reviewboard/webapi/tests/test_base.py (Diff revision 3)
     
     
     redefinition of unused 'test_disabled_feature_get_list' from line 125
    
  5. reviewboard/webapi/tests/test_base.py (Diff revision 3)
     
     
     redefinition of unused 'test_disabled_feature_get' from line 131
    
  6. reviewboard/webapi/tests/test_base.py (Diff revision 3)
     
     
    Col: 23
     E251 unexpected spaces around keyword / parameter equals
    
  7. reviewboard/webapi/tests/test_base.py (Diff revision 3)
     
     
    Col: 25
     E251 unexpected spaces around keyword / parameter equals
    
  8. 
      
Barret Rennie
Review Bot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/base.py
        reviewboard/webapi/tests/test_base.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/base.py
        reviewboard/webapi/tests/test_base.py
    
    
  2. 
      
David Trowbridge
  1. Mind making a change to use this for the status updates resource?

  2. reviewboard/webapi/tests/test_base.py (Diff revision 4)
     
     

    Blank line after the docstring.

  3. reviewboard/webapi/tests/test_base.py (Diff revision 4)
     
     

    Blank line after the docstring.

  4. reviewboard/webapi/tests/test_base.py (Diff revision 4)
     
     

    The suspense is killing me.

  5. 
      
Christian Hammond
  1. 
      
  2. reviewboard/webapi/base.py (Diff revision 4)
     
     
     
     
     

    This should also state that this is optional and what the default behavior is.

  3. reviewboard/webapi/base.py (Diff revision 4)
     
     
     
     
     
     

    The docs make this seem like the function is all about features. I think the summary and description should start off by just saying what call_method_view does, generally. Then it can modify that by talking about features, and about API policies (because this method ultimately takes that into account as well, even though the code in this block of code doesn't itself address it).

  4. reviewboard/webapi/tests/test_base.py (Diff revision 4)
     
     
     

    Blank line here.

  5. reviewboard/webapi/tests/test_base.py (Diff revision 4)
     
     

    Private methods go last.

  6. reviewboard/webapi/tests/test_base.py (Diff revision 4)
     
     
     
     

    No blank line here.

  7. 
      
Barret Rennie
Review Bot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/base.py
        reviewboard/webapi/tests/test_base.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/base.py
        reviewboard/webapi/tests/test_base.py
    
    
  2. 
      
David Trowbridge
  1. 
      
  2. reviewboard/webapi/base.py (Diff revision 5)
     
     

    Typo: specied.

  3. 
      
Barret Rennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (d239388)
Loading...