-
Notifications
You must be signed in to change notification settings - Fork 31
Allow any action to be checked with ["authContext"] expression #3954
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: main
Are you sure you want to change the base?
Conversation
Previously the only allowed actions were 'instantiate' | 'confirm' | 'sign' | 'reject' | 'read' | 'write' | 'complete'. Now any action that backend think is relevant for the task (based on proces.pbmn). Unknown actions triggers a warning (even thogh they are on the previously accepted list). This is a change in behaviour for previously buggy apps that used eg. `["authContext", "reject"]` without specifying `reject` as an action in bpmn. Previously authContext returned false, but now the whole expression fails. I tested that vsCode understands the trick with `"anyOf": ["enum", "string"]` and provides suggestions from the enum but accept any action.
📝 WalkthroughWalkthroughThe pull request broadens the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
olemartinorg
left a comment
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.
I see a shared test is failing, you should probably fix that one and make sure the behavior matches the backend. 🙌 Otherwise this LGTM! 🙌
|
|
||
| const authContext = buildAuthContext(this.dataSources.process?.currentTask); | ||
| return Boolean(authContext?.[key]); | ||
| const hasAction = authContext?.[key]; |
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.
I would probably call this hasPermissions instead. Now it reads like it contains a boolean that checks if the action exists.
Previously the only allowed actions were 'instantiate' | 'confirm' | 'sign' | 'reject' | 'read' | 'write' | 'complete'.
Now any action that backend think is relevant for the task (based on proces.pbmn). Unknown actions triggers a warning (even thogh they are on the previously accepted list).
This is a change in behaviour for previously buggy apps that used eg.
["authContext", "reject"]without specifyingrejectas an action in bpmn. Previously authContext returned false, but now the whole expression fails.I tested that vsCode understands the trick with
"anyOf": ["enum", "string"]and provides suggestions from the enum but accept any action.Verification/QA
kind/*andbackport*label to this PR for proper release notes groupingSummary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.