-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Regression: Permissions missing on new Room Edit and Contact Edit form #21315
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
Merged
Merged
Changes from 15 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
5a24a7d
Allow editing rooms in chat room
813dd40
Allow editing contact in chat room
2e72762
Fix default value error
4148e5c
Merge branch 'develop' into omnichannel/March2021-regression-2
renatobecker 0ec0172
Move chats and contacts file out of omnichannel directory
adb04eb
Merge with develop
d58e9fe
Merge branch 'develop' into omnichannel/March2021-regression-2
murtaza98 095caa7
Show edit option for room info only if the user has permission
60cc1d0
Refactor + display room tags within edit only if user has permission
9d2f736
Merge branch 'omnichannel/March2021-regression-2' of https://github.c…
145262e
Add permissions for editing omnichannel contact
2ddbee4
Merge branch 'develop' into omnichannel/March2021-regression-2
renatobecker 3c43b84
Merge branch 'develop' into omnichannel/March2021-regression-2
4a29157
Merge branch 'omnichannel/March2021-regression-2' of https://github.c…
84dbd72
Merge branch 'develop' into omnichannel/March2021-regression-2
renatobecker 2e4f364
Re-add permission
1245e29
Merge branch 'omnichannel/March2021-regression-2' of https://github.c…
1bb4a4d
Merge branch 'develop' into omnichannel/March2021-regression-2
eef4d0c
fix auto room-info panel routing issue
b58d191
Merge branch 'develop' into omnichannel/March2021-regression-2
rafaelblink 58fdaa3
Merge branch 'develop' into omnichannel/March2021-regression-2
rafaelblink 81ba860
Merge branch 'develop' into omnichannel/March2021-regression-2
renatobecker 7831b52
Merge branch 'develop' into omnichannel/March2021-regression-2
renatobecker 7fe895b
Fix Permissions.
renatobecker fb999c1
Fix indentation.
renatobecker 4397453
Merge branch 'develop' into omnichannel/March2021-regression-2
renatobecker cab6aa1
Merge branch 'omnichannel/March2021-regression-2' of https://github.c…
renatobecker 672122f
Merge branch 'develop' into omnichannel/March2021-regression-2
renatobecker 14306b4
Merge branch 'develop' into omnichannel/March2021-regression-2
renatobecker d082592
Merge branch 'develop' into omnichannel/March2021-regression-2
renatobecker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import React from 'react'; | ||
| import { Icon, Box } from '@rocket.chat/fuselage'; | ||
|
|
||
| import { ChatInfo } from './ChatInfo'; | ||
| import { RoomEditWithData } from './ChatRoomEdit'; | ||
| import VerticalBar from '../../../components/VerticalBar'; | ||
| import { useRoute, useRouteParameter } from '../../../contexts/RouterContext'; | ||
| import { useTranslation } from '../../../contexts/TranslationContext'; | ||
| import { useUserSubscription } from '../../../contexts/UserContext'; | ||
| import { hasPermission } from '../../../../app/authorization/client'; | ||
|
|
||
| const PATH = 'live'; | ||
|
|
||
| const ChatsContextualBar = ({ id }) => { | ||
| const t = useTranslation(); | ||
|
|
||
| const context = useRouteParameter('context'); | ||
|
|
||
| const directoryRoute = useRoute(PATH); | ||
|
|
||
| const subscription = useUserSubscription(id); | ||
| const hasGlobalEditRoomPermission = hasPermission('save-others-livechat-room-info'); | ||
|
|
||
| const hasEditAccess = !!subscription || hasGlobalEditRoomPermission; | ||
|
|
||
| const closeContextualBar = () => { | ||
| directoryRoute.push({ id }); | ||
| }; | ||
|
|
||
| const handleRoomEditBarCloseButtonClick = () => { | ||
| directoryRoute.push({ id, tab: 'room-info' }); | ||
| }; | ||
|
|
||
| return <> | ||
| <VerticalBar.Header> | ||
| <Box flexShrink={1} flexGrow={1} withTruncatedText mi='x8'><Icon name='info-circled' size='x20' /> {t('Room_Info')}</Box> | ||
| <VerticalBar.Close onClick={closeContextualBar} /> | ||
| </VerticalBar.Header> | ||
| {context === 'edit' && hasEditAccess ? <RoomEditWithData id={id} close={handleRoomEditBarCloseButtonClick} hasEditAccess={hasEditAccess} /> : <ChatInfo route={PATH} id={id} hasEditAccess={hasEditAccess} />} | ||
| </>; | ||
| }; | ||
|
|
||
| export default ({ rid }) => <ChatsContextualBar id={rid} />; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.