Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

Conversation

@mvilanova
Copy link
Contributor

No description provided.

@mvilanova mvilanova requested a review from kevgliss March 26, 2021 20:07
query = db_session.query(model_cls)

if user_role != UserRoles.admin.value:
if model.lower() == "incident":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to do something similar for tasks for restricted incidents?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to add logic for it, but when I started testing tasks I realized they were already being filtered. I did some research to try to figure out the why and the conclusion that I reached was that when we load /tasks we perform a GET against the /api/v1/incidents/ endpoint, which returns a list of filtered incidents, and then sqlalchemy filters out the tasks based on that list.

@lgtm-com
Copy link

lgtm-com bot commented Mar 26, 2021

This pull request introduces 4 alerts when merging 7e73d9d into b8b876c - view on LGTM.com

new alerts:

  • 4 for Unused import

@mvilanova mvilanova merged commit da8b145 into master Mar 26, 2021
@mvilanova mvilanova deleted the feature/restricted-incidents-view branch March 26, 2021 21:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants