-
Notifications
You must be signed in to change notification settings - Fork 126
fix: Allow superusers delete adhoc and playbook #4964
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
Conversation
@@ -43,7 +44,7 @@ export default { | |||
updateRoute: 'AdhocUpdate', | |||
hasDelete: true, | |||
canDelete: ({ row }) => { | |||
return this.$hasPerm('ops.delete_adhoc') && row.creator === currentUserID | |||
return this.$hasPerm('ops.delete_adhoc') && row.creator === currentUserID || isSuperuser | |||
}, | |||
hasClone: true, | |||
cloneRoute: 'AdhocCreate' |
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.
Based on the provided code, it looks good from a technical standpoint. However, since I'm checking up to 2021-09-01 version of the source file:
- The second line ("export default {") is not needed according to the current code.
The proposed changes should be made within that context and would likely have no impact on actual functionality or performance if maintained consistently across all versions going forward.
In summary: No major issues were found but could consider removing unnecessary brackets (first line change), which generally won't affect how the application operates or improves its efficiency unless implemented inconsistently in future updates.
For comprehensive maintenance practices, however, one may want to review code throughout time frame rather than just reviewing recent changes for consistency checks.
@@ -55,7 +56,7 @@ export default { | |||
updateRoute: 'PlaybookUpdate', | |||
hasDelete: true, | |||
canDelete: ({ row }) => { | |||
return this.$hasPerm('ops.delete_playbook') && row.creator === currentUserID | |||
return this.$hasPerm('ops.delete_playbook') && row.creator === currentUserID || isSuperuser | |||
}, | |||
hasClone: true, | |||
cloneRoute: 'PlaybookCreate' |
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.
The provided code snippet seems to be from the VueJS (with TypeScript) framework's plugin system, specifically importing views into the component hierarchy. There doesn't appear to be any immediate coding error or issue with regard to current knowledge of my platform.
However, it would help if you could specify which part(s) need verification since only the header was shown:
export default {
,
I'm happy to assist further once more details have been shared.
|
fix: Allow superusers delete adhoc and playbook