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

Method get

src/web/server.py:599–619  ·  view source on GitHub ↗
(self, user)

Source from the content-addressed store, hash-verified

597 @check_authorization
598 @inject_user
599 def get(self, user):
600 auth = self.application.auth
601 authorizer = self.application.authorizer
602
603 username = None
604 if auth.is_enabled():
605 username = auth.get_username(self)
606
607 try:
608 admin_rights = has_admin_rights(self)
609 except Exception:
610 admin_rights = False
611
612 info = {
613 'enabled': auth.is_enabled(),
614 'username': username,
615 'admin': admin_rights,
616 'canEditCode': authorizer.can_edit_code(user.user_id)
617 }
618
619 self.write(info)
620
621
622class AuthConfigHandler(BaseRequestHandler):

Callers

nothing calls this directly

Calls 5

has_admin_rightsFunction · 0.85
is_enabledMethod · 0.80
can_edit_codeMethod · 0.80
get_usernameMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected