Skip to content

Commit

Permalink
Update edit NOD permissions to just CoB (#16090)
Browse files Browse the repository at this point in the history
Resolves part of [CASEFLOW-1313](https://vajira.max.gov/browse/CASEFLOW-1313)

### Description
Updates permissions for editing NOD date from attorneys, judges, intake users, and Clerk of the Board to just Clerk of the Board.

### Acceptance Criteria
- [x] Code compiles correctly

### Testing Plan
1. Log in as `COB_USER`
2. Ensure you can edit an AMA appeal (210315-47 for example)
3. Switch to a judge, attorney, and intake user and ensure you can see the change in timeline on the appeal that was edited, but cannot edit NOD date
  • Loading branch information
bgantick authored Apr 7, 2021
1 parent 6320e6b commit 2a7f1b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
3 changes: 1 addition & 2 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ def can_view_hearing_schedule?
end

def can_view_edit_nod_date?
(attorney? || judge? || BvaIntake.singleton.users.include?(self) ||
ClerkOfTheBoard.singleton.users.include?(self)) && FeatureToggle.enabled?(:edit_nod_date, user: self)
ClerkOfTheBoard.singleton.users.include?(self) && FeatureToggle.enabled?(:edit_nod_date, user: self)
end

def can_vso_hearing_schedule?
Expand Down
17 changes: 9 additions & 8 deletions spec/feature/queue/case_details_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1369,7 +1369,7 @@

expect(appeal.nod_date).to_not be_nil
expect(page).to have_content(COPY::CASE_TIMELINE_NOD_RECEIVED)
expect(page).to have_content(COPY::CASE_DETAILS_EDIT_NOD_DATE_LINK_COPY)
expect(page).to_not have_content(COPY::CASE_DETAILS_EDIT_NOD_DATE_LINK_COPY)
end
end

Expand All @@ -1385,7 +1385,7 @@

expect(appeal.nod_date).to_not be_nil
expect(page).to have_content(COPY::CASE_TIMELINE_NOD_RECEIVED)
expect(page).to have_content(COPY::CASE_DETAILS_EDIT_NOD_DATE_LINK_COPY)
expect(page).to_not have_content(COPY::CASE_DETAILS_EDIT_NOD_DATE_LINK_COPY)
end
end

Expand All @@ -1402,15 +1402,16 @@

expect(appeal.nod_date).to_not be_nil
expect(page).to have_content(COPY::CASE_TIMELINE_NOD_RECEIVED)
expect(page).to have_content(COPY::CASE_DETAILS_EDIT_NOD_DATE_LINK_COPY)
expect(page).to_not have_content(COPY::CASE_DETAILS_EDIT_NOD_DATE_LINK_COPY)
end
end

context "when the user clicks on the edit nod button" do
let(:judge_user) { create(:user, css_id: "BVAOSHOWALT", station_id: "101") }
let(:cob_user) { create(:user, css_id: "COB_USER", station_id: "101") }

before do
User.authenticate!(user: judge_user)
ClerkOfTheBoard.singleton.add_user(cob_user)
User.authenticate!(user: cob_user)
end

let(:veteran_full_name) { veteran.first_name + veteran.last_name }
Expand Down Expand Up @@ -1546,12 +1547,12 @@
request_issues: request_issues)
end
subject { appeal.validate_all_issues_timely!(receipt_date) }
let(:judge_user) { create(:user, css_id: "BVAAABSHIRE", station_id: "101") }
let(:cob_user) { create(:user, css_id: "COB_USER", station_id: "101") }

before do
FeatureToggle.enable!(:edit_nod_date)
BvaDispatch.singleton.add_user(judge_user)
User.authenticate!(user: judge_user)
ClerkOfTheBoard.singleton.add_user(cob_user)
User.authenticate!(user: cob_user)
end

after { FeatureToggle.disable!(:edit_nod_date) }
Expand Down

0 comments on commit 2a7f1b4

Please sign in to comment.