mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Set admin privileges on websocket:
When the websocket connection is established, any configured administrative privileges are applied to resource limits.
This commit is contained in:
committed by
Vinnie Falco
parent
84c0ae1c6d
commit
8b8334af86
@@ -66,4 +66,15 @@ requestRole (Role const& required, HTTP::Port const& port,
|
||||
return role;
|
||||
}
|
||||
|
||||
Resource::Consumer
|
||||
requestInboundEndpoint (Resource::Manager& manager,
|
||||
beast::IP::Endpoint const& remoteAddress,
|
||||
HTTP::Port const& port)
|
||||
{
|
||||
if (requestRole (Role::GUEST, port, Json::Value(), remoteAddress) ==
|
||||
Role::ADMIN)
|
||||
return manager.newAdminEndpoint (to_string (remoteAddress));
|
||||
return manager.newInboundEndpoint(remoteAddress);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user