-
Notifications
You must be signed in to change notification settings - Fork 12
Keybindings respect permissions #2472
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
markus-moser
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.
@MSchinwaldEl
In general it LGTM, but there are at least the following lines missing:
studio-ui-bundle/assets/js/src/core/modules/element/editor/shared-tab-manager/tabs-container.tsx
Lines 60 to 62 in 5e0fcef
| useHandleKeyBindings(() => { if (element != null) rename(element.id, getElementKey(element as unknown as Element, elementType)) }, 'rename') | |
| useHandleKeyBindings(() => { if (element != null) publishNode(element as unknown as Element) }, 'publish') | |
| useHandleKeyBindings(() => { if (element != null && !isNull(elementType) && elementType !== 'asset') unpublishTreeNode(element as unknown as DataObject | Document) }, 'unpublish') |
I didn't implement the permission checks for these because, if I understand correctly, these keybindings can only be used in the element editor, which users can only open if they already have the appropriate permissions. |
|
@MSchinwaldEl You will find them in the related actions: studio-ui-bundle/assets/js/src/core/modules/element/actions/publish/use-publish.tsx Line 37 in a2fe4c2
studio-ui-bundle/assets/js/src/core/modules/element/actions/unpublish/use-unpublish.tsx Line 41 in a2fe4c2
studio-ui-bundle/assets/js/src/core/modules/element/actions/rename/use-rename.tsx Line 82 in a2fe4c2
but please use the enum for all locations, thanks |
I added the missing permissions. As discussed in our call, there are no enums for elementPermissions. |
|



Changes in this pull request