Skip to content

add "output" permission for output enable/disable - #2633

Merged
MaxKellermann merged 1 commit into
MusicPlayerDaemon:masterfrom
ryancdotorg:permission_output
Nov 29, 2026
Merged

MaxKellermann merged 1 commit into
MusicPlayerDaemon:masterfrom
ryancdotorg:permission_output

Conversation

@ryancdotorg

Copy link
Copy Markdown
Contributor

Summary

Adds a new output permission (PERMISSION_OUTPUT) and moves enableoutput, disableoutput, and toggleoutput from admin to output.

Motivation

Currently, allowing a client to switch or toggle audio outputs requires granting full admin privileges. I have a multi-output setup, and wanted to be able to enable output controls separately from kill, mount, unmount, update, etc.

Backwards Compatibility

  • admin implies output (mirroring how control implies player), so existing password / default_permissions configurations continue to work unchanged.
  • output is included in the default permissions that are used when no passwords are configured.

Changes

  • Added PERMISSION_OUTPUT (output) to src/Permission.hxx and src/Permission.cxx.
  • Changed enableoutput, disableoutput, and toggleoutput in src/command/AllCommands.cxx to require PERMISSION_OUTPUT instead of PERMISSION_ADMIN.
  • Updated documentation and example configuration.

Testing

I have been running and rebasing this patch on my own setups for a couple of years with no issues, and verified it builds and behaves as expected on current master.

@MaxKellermann

Copy link
Copy Markdown
Member

The code is fine, but this PR has text that is missing in the commit message. If you write text that you feel is necessary, then it should be part of the git repository and not be lost in GitHub's proprietary database. And add a NEWS line.

Adds a new `output` permission (`PERMISSION_OUTPUT`) and moves `enableoutput`, `disableoutput`, and `toggleoutput` from `admin` to `output`.

Currently, allowing a client to switch or toggle audio outputs requires granting full `admin` privileges. I have a multi-output setup, and wanted to be able to enable output controls separately from `kill`, `mount`, `unmount`, `update`, etc.

- `admin` implies `output` (mirroring how `control` implies `player`), so existing `password` / `default_permissions` configurations continue to work unchanged.
- `output` is included in the default permissions that are used when no passwords are configured.

- Added `PERMISSION_OUTPUT` (`output`) to `src/Permission.hxx` and `src/Permission.cxx`.
- Changed `enableoutput`, `disableoutput`, and `toggleoutput` in `src/command/AllCommands.cxx` to require `PERMISSION_OUTPUT` instead of `PERMISSION_ADMIN`.
- Updated documentation and example configuration.

I have been running and rebasing this patch on my own setups for a couple of years with no issues, and verified it builds and behaves as expected on current `master`.
@ryancdotorg

ryancdotorg commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Rebased and commit revised to include the PR text in the commit message itself, and an entry has been added to NEWS.

I didn't see anything about those conventions in the developer manual, would a separate PR adding them and a "Contributing: see developer manual" to the README also be welcome?

@MaxKellermann

Copy link
Copy Markdown
Member

What do you want to write there? The problem with documentation is that the more you have, the less likely is that people will read it. But of course, improvements to documentation are generally welcome.

@MaxKellermann
MaxKellermann merged commit cad3b20 into MusicPlayerDaemon:master Nov 29, 2026
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