mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-09-01 13:51:27 +02:00
restrict user ereader updates to devices with sole ownership
This commit is contained in:
parent
3d9d3687d7
commit
d21e19d828
@ -73,7 +73,7 @@
|
||||
<ui-btn color="primary flex items-center text-lg" @click="logout"><span class="material-symbols mr-4 icon-text">logout</span>{{ $strings.ButtonLogout }}</ui-btn>
|
||||
</div>
|
||||
|
||||
<modals-emails-user-e-reader-device-modal v-model="showEReaderDeviceModal" :existing-devices="ereaderDevices" :ereader-device="selectedEReaderDevice" @update="ereaderDevicesUpdated" />
|
||||
<modals-emails-user-e-reader-device-modal v-model="showEReaderDeviceModal" :existing-devices="revisedEreaderDevices" :ereader-device="selectedEReaderDevice" @update="ereaderDevicesUpdated" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -126,6 +126,9 @@ export default {
|
||||
},
|
||||
showEreaderTable() {
|
||||
return this.usertype !== 'root' && this.usertype !== 'admin' && this.user.permissions?.createEreader
|
||||
},
|
||||
revisedEreaderDevices() {
|
||||
return this.ereaderDevices.filter((device) => device.users?.length === 1)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -413,7 +413,7 @@ class MeController {
|
||||
}
|
||||
|
||||
const otherDevices = Database.emailSettings.ereaderDevices.filter((device) => {
|
||||
return !Database.emailSettings.checkUserCanAccessDevice(device, req.user)
|
||||
return !Database.emailSettings.checkUserCanAccessDevice(device, req.user) && device.users?.length === 1
|
||||
})
|
||||
const ereaderDevices = otherDevices.concat(userEReaderDevices)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user