MCPcopy
hub / github.com/HelloZeroNet/ZeroNet / actionAs

Method actionAs

src/Ui/UiWebsocket.py:323–331  ·  view source on GitHub ↗
(self, to, address, cmd, params=[])

Source from the content-addressed store, hash-verified

321 # - Actions -
322
323 def actionAs(self, to, address, cmd, params=[]):
324 if not self.hasSitePermission(address, cmd=cmd):
325 return self.response(to, "No permission for site %s" % address)
326 req_self = copy.copy(self)
327 req_self.site = self.server.sites.get(address)
328 req_self.hasCmdPermission = self.hasCmdPermission # Use the same permissions as current site
329 req_obj = super(UiWebsocket, req_self)
330 req = {"id": to, "cmd": cmd, "params": params}
331 req_obj.handleRequest(req)
332
333 # Do callback on response {"cmd": "response", "to": message_id, "result": result}
334 def actionResponse(self, to, result):

Callers

nothing calls this directly

Calls 5

hasSitePermissionMethod · 0.95
responseMethod · 0.95
copyMethod · 0.45
getMethod · 0.45
handleRequestMethod · 0.45

Tested by

no test coverage detected