Permission: split permission "player" from "control"
Some users want certain clients to fully control playback, but do not want them to be able to trigger database update. Closes https://github.com/MusicPlayerDaemon/MPD/issues/1124
This commit is contained in:
@@ -41,6 +41,7 @@ static constexpr struct {
|
||||
} permission_names[] = {
|
||||
{ "read", PERMISSION_READ },
|
||||
{ "add", PERMISSION_ADD },
|
||||
{ "player", PERMISSION_PLAYER },
|
||||
{ "control", PERMISSION_CONTROL },
|
||||
{ "admin", PERMISSION_ADMIN },
|
||||
{ nullptr, 0 },
|
||||
@@ -75,6 +76,11 @@ static unsigned parsePermissions(const char *string)
|
||||
if (!i.empty())
|
||||
permission |= ParsePermission(i);
|
||||
|
||||
/* for backwards compatiblity with MPD 0.22 and older,
|
||||
"control" implies "play" */
|
||||
if (permission & PERMISSION_CONTROL)
|
||||
permission |= PERMISSION_PLAYER;
|
||||
|
||||
return permission;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user