Skip to content
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

Allow users to create ereaders #3531

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

laustindasauce
Copy link

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

@@ -456,6 +456,7 @@
"LabelPermissionsAccessAllLibraries": "Can Access All Libraries",
"LabelPermissionsAccessAllTags": "Can Access All Tags",
"LabelPermissionsAccessExplicitContent": "Can Access Explicit Content",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please only edit the en-us.json file for the strings? We use Weblate to manage strings in all of the other translation files.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, no problem. Wasn't sure how that worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants