-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add facilities check on mobile appts #18486
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a separate check so we can return a unique error that FE can eventually use to trigger a banner saying that they don't have any facilities.
@@ -16,6 +16,7 @@ | |||
let!(:user) { sis_user(icn: '1012846043V576341') } | |||
|
|||
before do | |||
allow_any_instance_of(User).to receive(:va_patient?).and_return(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just adding the facilities was not working in this spec as it was transforming facilities into test facilities 984. This change is unique to testing env so not worried about effecting prod performance.
@@ -137,6 +137,7 @@ def appointments_cache_interface | |||
def authorize | |||
raise_access_denied unless current_user.authorize(:vaos, :access?) | |||
raise_access_denied_no_icn if current_user.icn.blank? | |||
raise_access_denied_no_facilities unless current_user.authorize(:vaos, :facilities?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kpethtel , I'm unsure if this warrants a flipper. It seems simple enough but let me know if you feel differently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
I don't think this merits a feature flag. We've been told this is the right thing to do and it makes conceptual sense. If it causes issues, those issues won't be 500s. They'll be user complaints. If we receive enough of those, we can stop checking the new policy and keep asking questions about why this isn't the right thing to do.
Is vaos also going to use the new policy?
@@ -4,4 +4,8 @@ | |||
def access? | |||
Flipper.enabled?('va_online_scheduling', user) && user.loa3? | |||
end | |||
|
|||
def facilities? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would facilities_access?
make sense here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah thats better. Updated.
@aherzberg please pull master to take care of the CVE |
@aherzberg let me know when you're ready to merge - I might have to override because of that EOF error |
@ryan-mcneil should be good to merge now. Looks like prod deploy has already gone out for the day so I should have the rest of the day to test it. Thanks! |
@aherzberg Ope maybe I missed it before, but there are also failing specs... are any of those potentially related to your changes? Otherwise let's take note of which ones are failing so I can talk to the respective teams and get eyes on them. Thanks! |
Dismissing until code checks are passing again
@ryan-mcneil I wasn't able to reproduce the errors locally on all 3 failures so was assuming it was all environment issues. I've been seeing a lot of that in the last week or so. The errors also effect specs that are unrelated to the code being changed |
Summary
Add Facilities check to VAOS policy. This will not effect VAOS controller.
created separate ticket to merge VAOS policy logic into same place: https://app.zenhub.com/workspaces/va-mobile-60f1a34998bc75000f2a489f/issues/gh/department-of-veterans-affairs/va-mobile-app/9617
Related issue(s)
department-of-veterans-affairs/va-mobile-app#9415
Testing done
Screenshots
Note: Optional
What areas of the site does it impact?
(Describe what parts of the site are impacted andifcode touched other areas)
Acceptance criteria
Requested Feedback
(OPTIONAL)What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?