MCPcopy Index your code
hub / github.com/bugy/script-server / wrapper

Function wrapper

src/web/server.py:55–62  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

53
54def requires_admin_rights(func):
55 def wrapper(self, *args, **kwargs):
56 if not has_admin_rights(self):
57 user_id = identify_user(self)
58 LOGGER.warning('User %s (%s) tried to access admin REST service %s',
59 user_id, get_audit_name_from_request(self), self.request.path)
60 raise tornado.web.HTTPError(403, 'Access denied')
61
62 return func(self, *args, **kwargs)
63
64 return wrapper
65

Callers

nothing calls this directly

Calls 3

identify_userFunction · 0.90
has_admin_rightsFunction · 0.85

Tested by

no test coverage detected