"Edit" button appears next to image titles that the user doesn't have permission to edit

Review Request #6747 — Created Jan. 8, 2015 and submitted

Information

Review Board
master
0ee0cd6...

Reviewers

Edit button and functionality was given to everyone as the check was not done on the front end. Checking with the model for ReviewRequestEditor was done to ensure edit permissions were allowed.

Testing was done manually with admin, users (people who created the issue, part of the group/issued to, or not part of the group) and visitors.

Description From Last Updated

This should use this.model.get('editable') rather than accessing the attributes object directly.

daviddavid

Actually, one last change. It's probably more correct to use === true rather than !== false (since if editable were …

daviddavid
reviewbot
  1. Tool: PEP8 Style Checker
    Ignored Files:
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
    
    Tool: Pyflakes
    Ignored Files:
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
  2. 
      
VT
brennie
  1. You can remove "Bug Issue 3306" from the title. The generated commit description will contain the bug number.

    You should add the students group to future reviews.

  2. 
      
VT
brennie
  1. Ship It!
  2. 
      
david
  1. 
      
  2. Show all issues

    This should use this.model.get('editable') rather than accessing the attributes object directly.

  3. 
      
VT
reviewbot
  1. Tool: Pyflakes
    Ignored Files:
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
  2. 
      
david
  1. 
      
  2. Show all issues

    Actually, one last change. It's probably more correct to use === true rather than !== false (since if editable were null or undefined, we wouldn't want to assume that it was OK to edit).

    1. editable will always be true or false in this case. It was only ever possible for it to be undefined in the options case.

  3. 
      
VT
reviewbot
  1. Tool: Pyflakes
    Ignored Files:
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
VT
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (cf9ad5d)