1 parent
b57b7cb606
commit
2200f2186c
3 files changed
+6
-4
No files matched your search
@@ -55,7 +55,10 @@ class UserManager(GroupChangeListener, object):
|
||||
if self.enabled:
|
||||
return AnonymousUser([self._group_manager.guest_group])
|
||||
else:
|
||||
return AdminUser([self._group_manager.admin_group])
|
||||
return AdminUser([self._group_manager.admin_group, self._group_manager.user_group])
|
||||
|
||||
def api_user_factory(self):
|
||||
return ApiUser([self._group_manager.admin_group, self._group_manager.user_group])
|
||||
|
||||
@property
|
||||
def enabled(self):
|
||||
|
||||
@@ -147,7 +147,7 @@ def load_user(id):
|
||||
return None
|
||||
|
||||
if id == "_api":
|
||||
return users.ApiUser([groupManager.admin_group])
|
||||
return userManager.api_user_factory()
|
||||
|
||||
if session and "usersession.id" in session:
|
||||
sessionid = session["usersession.id"]
|
||||
|
||||
@@ -12,7 +12,6 @@ PY3 = sys.version_info[0] == 3
|
||||
from octoprint.settings import settings
|
||||
import octoprint.timelapse
|
||||
import octoprint.server
|
||||
from octoprint.access.users import ApiUser
|
||||
|
||||
from octoprint.util import deprecated
|
||||
from octoprint.plugin import plugin_manager
|
||||
@@ -180,7 +179,7 @@ def get_user_for_apikey(apikey):
|
||||
if apikey is not None:
|
||||
if apikey == settings().get(["api", "key"]):
|
||||
# master key was used
|
||||
return ApiUser([octoprint.server.groupManager.admin_group])
|
||||
return octoprint.server.userManager.api_user_factory()
|
||||
|
||||
if octoprint.server.userManager.enabled:
|
||||
user = octoprint.server.userManager.find_user(apikey=apikey)
|
||||
|
||||
Reference in new issue
Block a user