Do not hide WebSocket API when missing permission (#6186)
This commit is contained in:
@@ -221,16 +221,12 @@ void PluginController::initSol(sol::state_view &lua, Plugin *plugin)
|
||||
lua::api::ChannelRef::createUserType(c2);
|
||||
lua::api::HTTPResponse::createUserType(c2);
|
||||
lua::api::HTTPRequest::createUserType(c2);
|
||||
lua::api::WebSocket::createUserType(c2, plugin);
|
||||
c2["ChannelType"] = lua::createEnumTable<Channel::Type>(lua);
|
||||
c2["HTTPMethod"] = lua::createEnumTable<NetworkRequestType>(lua);
|
||||
c2["EventType"] = lua::createEnumTable<lua::api::EventType>(lua);
|
||||
c2["LogLevel"] = lua::createEnumTable<lua::api::LogLevel>(lua);
|
||||
|
||||
if (plugin->hasNetworkPermission())
|
||||
{
|
||||
lua::api::WebSocket::createUserType(c2, plugin);
|
||||
}
|
||||
|
||||
sol::table io = g["io"];
|
||||
io.set_function(
|
||||
"open", sol::overload(&lua::api::io_open, &lua::api::io_open_modeless));
|
||||
|
||||
Reference in New Issue
Block a user