-
Notifications
You must be signed in to change notification settings - Fork 30
Add global functions user permissions 🎨 #7868
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 global functions user permissions 🎨 #7868
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7868 +/- ##
==========================================
+ Coverage 87.80% 87.98% +0.18%
==========================================
Files 1791 1753 -38
Lines 69717 68606 -1111
Branches 1220 1065 -155
==========================================
- Hits 61214 60366 -848
+ Misses 8151 7924 -227
+ Partials 352 316 -36
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
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 sound.
I am wondering a few things here:
- why are the permissions + access rights only checked on the webserver level and not already in the api-server?
- what is the concept/difference between permissions and abilities?
- you are missing some tests on these new exceptions on the api-server side.
...re_postgres_database/migration/versions/4e015ffa304e_add_functions_global_group_abilities.py
Outdated
Show resolved
Hide resolved
services/web/server/src/simcore_service_webserver/functions/_functions_repository.py
Outdated
Show resolved
Hide resolved
services/api-server/src/simcore_service_api_server/api/routes/functions_routes.py
Outdated
Show resolved
Hide resolved
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.
Some initial questions
...re_postgres_database/migration/versions/4e015ffa304e_add_functions_global_group_abilities.py
Outdated
Show resolved
Hide resolved
services/web/server/src/simcore_service_webserver/functions/_controller/_functions_rpc.py
Show resolved
Hide resolved
services/web/server/src/simcore_service_webserver/functions/_functions_service.py
Show resolved
Hide resolved
services/web/server/tests/unit/with_dbs/04/functions_rpc/test_functions_controller_rpc.py
Outdated
Show resolved
Hide resolved
...stgres-database/src/simcore_postgres_database/models/funcapi_function_api_group_abilities.py
Outdated
Show resolved
Hide resolved
...stgres-database/src/simcore_postgres_database/models/funcapi_function_api_group_abilities.py
Outdated
Show resolved
Hide resolved
…geit/osparc-simcore into add_global_functions_user_abilities
Wrt to 1. I just checked on the deepest level which looked like the safest/most efficient. If i do it in the api-server I would also have to pull the permissions out of the db with rpc calls. I consider it better to avoid that and let the repository layer handle all this immediately? One exception is running functions, because there the function is implemented in the api server, for now. |
…geit/osparc-simcore into add_global_functions_user_abilities
…geit/osparc-simcore into add_global_functions_user_abilities
@mergify queue |
🟠 Waiting for conditions to match
|
@mergify update |
☑️ Nothing to do, the required conditions are not met
|
@mergify refresh |
✅ Pull request refreshed |
@mergify refresh |
✅ Pull request refreshed |
@mergify queue |
🟠 Waiting for conditions to match
|
|
@mergify refresh |
✅ Pull request refreshed |
What do these changes do?
This will allow control of which users/user groups are allowed to read/write(create)/execute functions, function jobs and function job collections, on a global level per product. This is different from a PR where the permissions 'per function object' were introduced.
This could be linked to the frontend in a future PR, by exposing a webserver rest api where the frontend can ask for the global permissions of a user to affect e.g. the appearance of the 'create function' panel.
Related issue/s
How to test
Try to run/read/create a function as a user who doesn't have access to, the appropriate permission denied error should be returned.
Dev-ops
No changes to ENV.
Migration script will introduce a new table that will by default deny all access to function abilities to all users. To enable access for a certain group, add a row to the funcapi_group_api_access_rights table, with in each column a bool enabling/disabling the particular right for that group.