-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
fixed admin room access issues #5543
fixed admin room access issues #5543
Conversation
Can you confirm if this issue is only with the Shared Access tab? Can an admin do other operations on the room as expected even if the room is shared with them? |
Yes, admins can perform other operations as expected when a room is shared with them. |
@@ -37,6 +38,9 @@ export default function SharedAccess() { | |||
const { data: sharedUsers } = useSharedUsers(friendlyId, searchInput); | |||
const deleteSharedAccess = useDeleteSharedAccess(friendlyId); | |||
const { data: room } = useRoom(friendlyId); | |||
const currentUser = useAuth(); | |||
const isAdmin = currentUser?.role.name === 'Administrator'; | |||
const isOwner = room?.owner_name === currentUser?.name; |
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.
Going based off of the room owner's name isn't a good idea here. What if someone else has teh same name?
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.
You should use the room.shared
instead
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.
That's a good point! I updated the code to use the room.shared boolean instead of owner name
Kudos, SonarCloud Quality Gate passed!
|
* fixed admin room access issues * fixed eslint errors * updated to use room shared boolean over owner name
fixes #5445