some fixes

This commit is contained in:
WolverinDEV 2019-07-31 21:58:21 +02:00
commit b07933ea08

View File

@ -3015,8 +3015,8 @@ CommandResult ConnectedClient::handleCommandServerGroupAutoAddPerm(ts::Command&
permission::v2::PermissionUpdateType::set_value, permission::v2::PermissionUpdateType::set_value,
permission::v2::PermissionUpdateType::do_nothing, permission::v2::PermissionUpdateType::do_nothing,
cmd[index]["permnegated"].as<bool>() ? 1 : 0, cmd[index]["permskip"].as<bool>() ? 1 : 0,
cmd[index]["permskip"].as<bool>() ? 1 : 0 cmd[index]["permnegated"].as<bool>() ? 1 : 0
); );
} }
} }
@ -5801,7 +5801,7 @@ CommandResult ConnectedClient::handleCommandPermOverview(Command &cmd) {
result[index]["s"] = permission.flags.skip; result[index]["s"] = permission.flags.skip;
index++; index++;
} }
if(permission.flags.skip) { if(permission.flags.grant_set) {
result[index]["t"] = 0; /* server group */ result[index]["t"] = 0; /* server group */
result[index]["id1"] = server_group->group->groupId(); result[index]["id1"] = server_group->group->groupId();
result[index]["id2"] = 0; result[index]["id2"] = 0;
@ -5829,7 +5829,7 @@ CommandResult ConnectedClient::handleCommandPermOverview(Command &cmd) {
result[index]["s"] = permission.flags.skip; result[index]["s"] = permission.flags.skip;
index++; index++;
} }
if(permission.flags.skip) { if(permission.flags.grant_set) {
result[index]["t"] = 1; /* client */ result[index]["t"] = 1; /* client */
result[index]["id1"] = client_dbid; result[index]["id1"] = client_dbid;
result[index]["id2"] = 0; result[index]["id2"] = 0;
@ -5858,7 +5858,7 @@ CommandResult ConnectedClient::handleCommandPermOverview(Command &cmd) {
result[index]["s"] = permission.flags.skip; result[index]["s"] = permission.flags.skip;
index++; index++;
} }
if(permission.flags.skip) { if(permission.flags.grant_set) {
result[index]["t"] = 2; /* server channel */ result[index]["t"] = 2; /* server channel */
result[index]["id1"] = channel->channelId(); result[index]["id1"] = channel->channelId();
result[index]["id2"] = 0; result[index]["id2"] = 0;
@ -5887,7 +5887,7 @@ CommandResult ConnectedClient::handleCommandPermOverview(Command &cmd) {
result[index]["s"] = permission.flags.skip; result[index]["s"] = permission.flags.skip;
index++; index++;
} }
if(permission.flags.skip) { if(permission.flags.grant_set) {
result[index]["t"] = 3; /* channel group */ result[index]["t"] = 3; /* channel group */
result[index]["id1"] = channel_group->channelId; result[index]["id1"] = channel_group->channelId;
result[index]["id2"] = channel_group->group->groupId(); result[index]["id2"] = channel_group->group->groupId();
@ -5915,7 +5915,7 @@ CommandResult ConnectedClient::handleCommandPermOverview(Command &cmd) {
result[index]["s"] = permission.flags.skip; result[index]["s"] = permission.flags.skip;
index++; index++;
} }
if(permission.flags.skip) { if(permission.flags.grant_set) {
result[index]["t"] = 1; /* client */ result[index]["t"] = 1; /* client */
result[index]["id1"] = std::get<1>(permission_data); result[index]["id1"] = std::get<1>(permission_data);
result[index]["id2"] = client_dbid; result[index]["id2"] = client_dbid;
@ -6605,7 +6605,7 @@ CommandResult ConnectedClient::handleCommandPlaylistAddPerm(ts::Command &cmd) {
playlist->permissions()->setPermissionGranted(permType, cmd[index]["permvalue"], nullptr); playlist->permissions()->setPermissionGranted(permType, cmd[index]["permvalue"], nullptr);
} else { } else {
playlist->permissions()->setPermission(permType, cmd[index]["permvalue"], nullptr, cmd[index]["permnegated"], cmd[index]["permskip"]); playlist->permissions()->setPermission(permType, cmd[index]["permvalue"], nullptr, cmd[index]["permskip"], cmd[index]["permnegated"]);
} }
} }