[PR #3531] [MERGED] Allow users to create ereaders #4007

Closed
opened 2026-04-25 00:17:56 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3531
Author: @laustindasauce
Created: 10/17/2024
Status: Merged
Merged: 10/26/2024
Merged by: @advplyr

Base: masterHead: feature/user-ereader-creation


📝 Commits (10+)

  • 24b4fd7 add create eReader permission toggle
  • 892cb53 add english label for create EReader permission
  • 112a856 add ereader table to account with user specific modal
  • dbc04d5 add createEreader permission
  • 43f3e5e create api endpoint and logic for updating user eReader devices
  • c43783a Merge branch 'advplyr:master' into feature/user-ereader-creation
  • 9ccdf30 add translated label for createEreader permission
  • b9772a0 handle name duplicates and remove helper func
  • 3d9d368 toast for duplicate name error caught on server
  • d21e19d restrict user ereader updates to devices with sole ownership

📊 Changes

7 files changed (+354 additions, -3 deletions)

View changed files

📝 client/components/modals/AccountModal.vue (+13 -2)
client/components/modals/emails/UserEReaderDeviceModal.vue (+188 -0)
📝 client/pages/account.vue (+97 -1)
📝 client/strings/en-us.json (+1 -0)
📝 server/controllers/MeController.js (+52 -0)
📝 server/models/User.js (+2 -0)
📝 server/routers/ApiRouter.js (+1 -0)

📄 Description

Allow users to create ereaders

This is an enhancement feature that should close issue #1982 when merged. The purpose is to allow self-serve of the ereader devices by users of an Audiobookshelf instance. Personally, I'd much rather pass on the handling of ereader devices to the users themselves. Since it's disabled by default, it won't have any effect on current instances and only those who would like to utilize the feature can now have the opportunity to.

What's Changed

Client

  • Created label for new permission with value 'Can Create Ereader'
  • Added toggle to Account modal for user update/creation
  • For non admin/root, added ereader table to account page above logout button
    • Only allows edit/delete options for ereaders solely accessible by the user
  • Created new user ereader modal for creating/updating ereaders at user level
    • Removes accessibility options from the form (only name & email can be changed)
    • Only passes ereader devices solely accessible by the user to modal
  • Toast for duplicate name error when found by server

Server

  • Added createEreader permission for users with default false except for admin / root
  • Created new API route - POST: /api/me/ereader-devices
  • New MeController method to handle the route
    • Handles check for duplicate names across ereader devices not owned by the user
    • Only allows update/deletion/creation of devices with the current user as the only accessible user

Screenshots

User account page with createEreader permission

Admin users page with new toggle


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/3531 **Author:** [@laustindasauce](https://github.com/laustindasauce) **Created:** 10/17/2024 **Status:** ✅ Merged **Merged:** 10/26/2024 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `feature/user-ereader-creation` --- ### 📝 Commits (10+) - [`24b4fd7`](https://github.com/advplyr/audiobookshelf/commit/24b4fd7a1d6cc5ba6de39b3d2938fa0a11dc4311) add create eReader permission toggle - [`892cb53`](https://github.com/advplyr/audiobookshelf/commit/892cb5385b46ba7751f6932b557e89d6887e4699) add english label for create EReader permission - [`112a856`](https://github.com/advplyr/audiobookshelf/commit/112a856156e9406afe008cf88eddb6dc708a6cfa) add ereader table to account with user specific modal - [`dbc04d5`](https://github.com/advplyr/audiobookshelf/commit/dbc04d5bb3d120cd0c5c9cb6581c0b29e35d99bd) add createEreader permission - [`43f3e5e`](https://github.com/advplyr/audiobookshelf/commit/43f3e5ee03e3b4739d917d9572b687ca18668b7d) create api endpoint and logic for updating user eReader devices - [`c43783a`](https://github.com/advplyr/audiobookshelf/commit/c43783a2ca038c6c38919fab848f79c29fad9229) Merge branch 'advplyr:master' into feature/user-ereader-creation - [`9ccdf30`](https://github.com/advplyr/audiobookshelf/commit/9ccdf305fe77e434dd40c6f361f506f8180668ed) add translated label for createEreader permission - [`b9772a0`](https://github.com/advplyr/audiobookshelf/commit/b9772a024c43a677f08d953a6dcdf232318fc015) handle name duplicates and remove helper func - [`3d9d368`](https://github.com/advplyr/audiobookshelf/commit/3d9d3687d715d05b745d0e136879d0d166ba319e) toast for duplicate name error caught on server - [`d21e19d`](https://github.com/advplyr/audiobookshelf/commit/d21e19d82849985c45364f59ae09f6b489c02c36) restrict user ereader updates to devices with sole ownership ### 📊 Changes **7 files changed** (+354 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `client/components/modals/AccountModal.vue` (+13 -2) ➕ `client/components/modals/emails/UserEReaderDeviceModal.vue` (+188 -0) 📝 `client/pages/account.vue` (+97 -1) 📝 `client/strings/en-us.json` (+1 -0) 📝 `server/controllers/MeController.js` (+52 -0) 📝 `server/models/User.js` (+2 -0) 📝 `server/routers/ApiRouter.js` (+1 -0) </details> ### 📄 Description # Allow users to create ereaders This is an enhancement feature that should close issue #1982 when merged. The purpose is to allow self-serve of the ereader devices by users of an Audiobookshelf instance. Personally, I'd much rather pass on the handling of ereader devices to the users themselves. Since it's disabled by default, it won't have any effect on current instances and only those who would like to utilize the feature can now have the opportunity to. ## What's Changed ### Client - Created label for new permission with value 'Can Create Ereader' - Added toggle to Account modal for user update/creation - For non admin/root, added ereader table to account page above logout button - Only allows edit/delete options for ereaders solely accessible by the user - Created new user ereader modal for creating/updating ereaders at user level - Removes accessibility options from the form (only name & email can be changed) - Only passes ereader devices solely accessible by the user to modal - Toast for duplicate name error when found by server ### Server - Added `createEreader` permission for users with default false except for admin / root - Created new API route - POST: `/api/me/ereader-devices` - New MeController method to handle the route - Handles check for duplicate names across ereader devices not owned by the user - Only allows update/deletion/creation of devices with the current user as the **only** accessible user ## Screenshots User account page with createEreader permission ![](https://i.imgur.com/qcNKqS1.png) Admin users page with new toggle ![](https://i.imgur.com/3WEuBl7.png) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:17:56 +02:00
adam closed this issue 2026-04-25 00:17:56 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4007