MCPcopy Index your code
hub / github.com/tiny-pilot/tinypilot / OneAdminRequiredError

Class OneAdminRequiredError

app/auth.py:64–75  ·  view source on GitHub ↗

Raised to prevent that the system wouldn’t have any admin user. Without any admin user, the system would effectively be in a locked state where no one can manage the settings anymore. (Including e.g. creating a new admin user, or otherwise elevating a user’s privileges.) Note that

Source from the content-addressed store, hash-verified

62
63
64class OneAdminRequiredError(Error):
65 """Raised to prevent that the system wouldn’t have any admin user.
66
67 Without any admin user, the system would effectively be in a locked state
68 where no one can manage the settings anymore. (Including e.g. creating a
69 new admin user, or otherwise elevating a user’s privileges.)
70
71 Note that the purpose of this error is to protect the system’s integrity as
72 a whole. In addition to that, we may also carry out separate checks (e.g.
73 in the API layer) to prevent the current user from accidentally locking
74 themselves out individually (without violating the system integrity).
75 """
76
77
78def _user_from_strings(username, role, credentials_last_changed):

Callers 3

registerFunction · 0.85
change_roleFunction · 0.85
delete_accountFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected