Add some docstrings.
This commit is contained in:
parent
6c99204828
commit
d44f59a0e7
|
@ -72,6 +72,16 @@ class AuthManager(component.Component):
|
|||
pass
|
||||
|
||||
def peek(self, username):
|
||||
"""
|
||||
Peeks users based on username and returns their auth level
|
||||
|
||||
:param username: str, username
|
||||
:returns: int, the auth level for this user
|
||||
:rtype: int
|
||||
|
||||
:raises BadLoginError: if the username does not exist or password does not match
|
||||
|
||||
"""
|
||||
if username not in self.__auth:
|
||||
# Let's try to re-load the file.. Maybe it's been updated
|
||||
self.__load_auth_file()
|
||||
|
|
|
@ -254,6 +254,9 @@ class DelugeRPCProtocol(Protocol):
|
|||
))
|
||||
|
||||
if method == "daemon.peek":
|
||||
# This is a special case and used in the initial connection process
|
||||
# We need to peek the user here in order to get an auth level back
|
||||
# and see if the user exists.
|
||||
try:
|
||||
ret = component.get("AuthManager").peek(*args, **kwargs)
|
||||
if ret:
|
||||
|
|
Loading…
Reference in New Issue