-
Notifications
You must be signed in to change notification settings - Fork 33
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
Catalog returns only the functions that you can run #1540
Conversation
@@ -49,7 +49,7 @@ | |||
"password": "pbkdf2_sha256$390000$kcex1rxhZg6VVJYkx71cBX$e4ns0xDykbO6Dz6j4nZ4uNusqkB9GVpojyegPv5/9KM=", | |||
"is_active": true, | |||
"groups": [ | |||
101 | |||
100 |
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 to change the user group to the runner one that has the run
permission.
gateway/api/views/programs.py
Outdated
author = self.request.user | ||
type_filter = self.request.query_params.get("filter") | ||
|
||
if type_filter == "serverless": |
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.
@korgan00 let's comment about these values, Monday. I think we can use the Enum
approach that we used in the last PR but how they don't accept strings if we don't use StrEnum
we will need to compare them in a different way probably.
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.
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.
LGTM
* move program model access to repository * remove unused code * fix linter * fixed tests * update swagger information * added logger in the repository class * rename provider method * added TypeFilter enum * fix typo
Summary
This is PR continues the work done in #1526
The end-point that returns the list of the Functions for the Catalog is returning all the those Functions with
view
permission. This was generating some frustrations becauseview
permission doesn't give you access to run them. So with this PR now we will return only those functions for what the user hasrun
permission.This PR also introduces a refactor around how
GET
end-points fromProgram
view were managing the access to the model. With the purpose to continue adding good practices to the base code we are starting to introduce some new concepts:Repository
class. In this case we started with theget
methods for theProgram
view. We will continue the refactor in future PR.list
end-point doesn't filter by title. We are doing that using the end-pointget_by_title
.