Skip to content

Commit

Permalink
Merge pull request #12964 from nextcloud/fix/12955/hide-ban-for-feder…
Browse files Browse the repository at this point in the history
…ated-users

fix(Participant): hide ban option for federated users
  • Loading branch information
nickvergessen authored Aug 15, 2024
2 parents 681add4 + d9e6c9c commit d4899f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/RightSidebar/Participants/Participant.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -709,11 +709,11 @@ describe('Participant.vue', () => {
await testCanBan()
})

test('allows a moderator to ban a federated user', async () => {
test('doesn not allow a moderator to ban a federated user', async () => {
conversation.participantType = PARTICIPANT.TYPE.MODERATOR
participant.actorType = ATTENDEE.ACTOR_TYPE.FEDERATED_USERS
participant.participantType = PARTICIPANT.TYPE.USER
await testCanBan()
await testCannotBan()
})

test('allows a moderator to ban a guest', async () => {
Expand Down
8 changes: 7 additions & 1 deletion src/components/RightSidebar/Participants/Participant.vue
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
:name="removeParticipantLabel"
:container="container">
<p> {{ removeDialogMessage }} </p>
<template v-if="supportBanV1 && showPermissionsOptions">
<template v-if="showBanOption">
<NcCheckboxRadioSwitch :checked.sync="isBanParticipant">
{{ t('spreed', 'Also ban from this conversation') }}
</NcCheckboxRadioSwitch>
Expand Down Expand Up @@ -742,6 +742,12 @@ export default {
return this.participantTypeIsModerator(this.participantType)
},

showBanOption() {
return this.supportBanV1
&& this.participant.actorType !== ATTENDEE.ACTOR_TYPE.FEDERATED_USERS
&& this.showPermissionsOptions
},

showPermissionsOptions() {
return this.canBeModerated
&& !this.isModerator
Expand Down

0 comments on commit d4899f7

Please sign in to comment.