-
Notifications
You must be signed in to change notification settings - Fork 30
✨ [Frontend] Check if my group can write_functions
#7888
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
base: master
Are you sure you want to change the base?
Conversation
write_functions
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.
Pull Request Overview
This PR ensures that the “Create Functions” section is only shown when the user’s group has the write_functions
permission by:
- Adding a new
functionPermissions
endpoint and loading both general and function-specific permissions at startup - Refactoring
Permissions
to store and expose group-level and function-level permissions viacheckMyGroupCanDo
andcheckFunctionPermissions
- Updating UI components (
NodeOptions
,ResourceDetails
) to use the new permission checks and automatically rebuild layouts
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
services/static-webserver/client/source/class/osparc/widget/NodeOptions.js | Renamed buildLayout to private __buildLayout and applied it on node property; switched permission check to checkMyGroupCanDo |
services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js | Removed manual buildLayout call now handled by the property apply |
services/static-webserver/client/source/class/osparc/desktop/MainPage.js | Preload both general and function permissions before rendering |
services/static-webserver/client/source/class/osparc/data/Resources.js | Added functionPermissions resource definition |
services/static-webserver/client/source/class/osparc/data/Permissions.js | Introduced __permissions and __functionPermissions , methods to fetch and check them |
services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js | Changed plugin-disabled check to use checkFunctionPermissions |
Comments suppressed due to low confidence (3)
services/static-webserver/client/source/class/osparc/data/Permissions.js:300
- [nitpick] Consider adding a JSDoc comment to explain the purpose of
fetchFunctionPermissions
and its relationship with__functionPermissions
.
fetchFunctionPermissions: function() {
services/static-webserver/client/source/class/osparc/desktop/MainPage.js:73
- New startup permission-fetching logic should be covered by tests to ensure both general and function permissions are loaded before the UI displays.
preloadPromises.push(osparc.data.Permissions.getInstance().fetchPermissions());
services/static-webserver/client/source/class/osparc/data/Permissions.js:317
- The variable
functionPermissions
is undefined here; it should referencethis.__functionPermissions[action]
.
return functionPermissions[action];
|
What do these changes do?
In order to show the
Create Functions
section, make sure the user can create functions.Related issue/s
/me/function-permissions
Endpoint in Functions Domain #7901How to test
Dev-ops