aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ. Alexander Treuman <jat@spatialrift.net>2006-08-07 15:48:16 +0000
committerJ. Alexander Treuman <jat@spatialrift.net>2006-08-07 15:48:16 +0000
commit7f4f3010a5cba4346c74646c5419ce782bf434d0 (patch)
treecb8c7600546521d264743c83d184999d3c42dcff /src
parent7c9d3c4186adeeb712117580a8523d647623141c (diff)
downloadmpd-7f4f3010a5cba4346c74646c5419ce782bf434d0.tar.gz
mpd-7f4f3010a5cba4346c74646c5419ce782bf434d0.tar.xz
mpd-7f4f3010a5cba4346c74646c5419ce782bf434d0.zip
Add PERMISSION_NONE define, for commands that require no permission
git-svn-id: https://svn.musicpd.org/mpd/trunk@4583 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src')
-rw-r--r--src/command.c10
-rw-r--r--src/permission.h9
2 files changed, 10 insertions, 9 deletions
diff --git a/src/command.c b/src/command.c
index efdc4bea6..0817b983f 100644
--- a/src/command.c
+++ b/src/command.c
@@ -983,7 +983,7 @@ void initCommands(void)
addCommand(COMMAND_PAUSE, PERMISSION_CONTROL, 0, 1, handlePause, NULL);
addCommand(COMMAND_STATUS, PERMISSION_READ, 0, 0, commandStatus, NULL);
addCommand(COMMAND_KILL, PERMISSION_ADMIN, -1, -1, handleKill, NULL);
- addCommand(COMMAND_CLOSE, 0, -1, -1, handleClose, NULL);
+ addCommand(COMMAND_CLOSE, PERMISSION_NONE, -1, -1, handleClose, NULL);
addCommand(COMMAND_ADD, PERMISSION_ADD, 1, 1, handleAdd, NULL);
addCommand(COMMAND_ADDID, PERMISSION_ADD, 1, 1, handleAddId, NULL);
addCommand(COMMAND_DELETE, PERMISSION_CONTROL, 1, 1, handleDelete, NULL);
@@ -1018,9 +1018,9 @@ void initCommands(void)
addCommand(COMMAND_SEEK, PERMISSION_CONTROL, 2, 2, handleSeek, NULL);
addCommand(COMMAND_SEEKID, PERMISSION_CONTROL, 2, 2, handleSeekId, NULL);
addCommand(COMMAND_LISTALLINFO, PERMISSION_READ, 0, 1, handleListAllInfo, NULL);
- addCommand(COMMAND_PING, 0, 0, 0, handlePing, NULL);
+ addCommand(COMMAND_PING, PERMISSION_NONE, 0, 0, handlePing, NULL);
addCommand(COMMAND_SETVOL, PERMISSION_CONTROL, 1, 1, handleSetVol, NULL);
- addCommand(COMMAND_PASSWORD, 0, 1, 1, handlePassword, NULL);
+ addCommand(COMMAND_PASSWORD, PERMISSION_NONE, 1, 1, handlePassword, NULL);
addCommand(COMMAND_CROSSFADE, PERMISSION_CONTROL, 1, 1, handleCrossfade, NULL);
addCommand(COMMAND_URL_HANDLERS, PERMISSION_READ, 0, 0, handleUrlHandlers, NULL);
addCommand(COMMAND_PLCHANGES, PERMISSION_READ, 1, 1, handlePlaylistChanges, NULL);
@@ -1028,8 +1028,8 @@ void initCommands(void)
addCommand(COMMAND_ENABLE_DEV, PERMISSION_ADMIN, 1, 1, handleEnableDevice, NULL);
addCommand(COMMAND_DISABLE_DEV, PERMISSION_ADMIN, 1, 1, handleDisableDevice, NULL);
addCommand(COMMAND_DEVICES, PERMISSION_READ, 0, 0, handleDevices, NULL);
- addCommand(COMMAND_COMMANDS, 0, 0, 0, handleCommands, NULL);
- addCommand(COMMAND_NOTCOMMANDS, 0, 0, 0, handleNotcommands, NULL);
+ addCommand(COMMAND_COMMANDS, PERMISSION_NONE, 0, 0, handleCommands, NULL);
+ addCommand(COMMAND_NOTCOMMANDS, PERMISSION_NONE, 0, 0, handleNotcommands, NULL);
sortList(commandList);
}
diff --git a/src/permission.h b/src/permission.h
index ad0e7b4bc..b34576f1a 100644
--- a/src/permission.h
+++ b/src/permission.h
@@ -21,10 +21,11 @@
#include "../config.h"
-#define PERMISSION_READ 1
-#define PERMISSION_ADD 2
-#define PERMISSION_CONTROL 4
-#define PERMISSION_ADMIN 8
+#define PERMISSION_NONE 0
+#define PERMISSION_READ 1
+#define PERMISSION_ADD 2
+#define PERMISSION_CONTROL 4
+#define PERMISSION_ADMIN 8
void initPermissions();