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

Add podcast permissions for non-admin users #3933

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eudaldgr
Copy link

@eudaldgr eudaldgr commented Feb 4, 2025

Fixes #1258

Add user permissions for uploading podcasts and downloading episodes.

  • Update client/components/app/SideRail.vue to check for userCanUpload instead of userIsAdminOrUp for podcast search and download queue links.
  • Add getUserCanUpload getter in client/store/user.js to check the new upload permission.
  • Update server/controllers/PodcastController.js to allow users with the upload permission to create and download podcasts.
  • Add upload permission for non-admin users in server/models/User.js.
  • Add upload permission toggle switch in client/components/modals/AccountModal.vue.

For more details, open the Copilot Workspace session.

Fixes advplyr#1258

Add user permissions for uploading podcasts and downloading episodes.

* Update `client/components/app/SideRail.vue` to check for `userCanUpload` instead of `userIsAdminOrUp` for podcast search and download queue links.
* Add `getUserCanUpload` getter in `client/store/user.js` to check the new `upload` permission.
* Update `server/controllers/PodcastController.js` to allow users with the `upload` permission to create and download podcasts.
* Add `upload` permission for non-admin users in `server/models/User.js`.
* Add `upload` permission toggle switch in `client/components/modals/AccountModal.vue`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/advplyr/audiobookshelf/issues/1258?shareId=XXXX-XXXX-XXXX-XXXX).
@@ -169,7 +169,7 @@ class User extends Model {
download: true,
update: type === 'root' || type === 'admin',
delete: type === 'root',
upload: type === 'root' || type === 'admin',
upload: type === 'root' || type === 'admin' || type === 'user',
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think upload should be default for users

@@ -477,7 +477,7 @@ class User extends Model {
* User data for clients
* Emitted on socket events user_online, user_offline and user_stream_update
*
* @param {import('../objects/PlaybackSession')[]} sessions
* @param {import('../objects/PlaybackSession')} sessions
Copy link
Owner

Choose a reason for hiding this comment

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

Is this not an array of sessions?

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.

[Enhancement]: New user permissions for managing podcasts
2 participants