这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/web_interface/components/miscellaneous_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, *args, **kwargs):
self.stats_updater = StatsUpdater(stats_db=self.db.stats_updater)

@login_required
@roles_accepted(*PRIVILEGES['status'])
@roles_accepted(no_role_needed=True)
@AppRoute('/', GET)
def show_home(self):
latest_count = config.frontend.number_of_latest_firmwares_to_display
Expand Down
4 changes: 2 additions & 2 deletions src/web_interface/security/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import config


def roles_accepted(*roles):
def roles_accepted(*roles, no_role_needed: bool = False):
def wrapper(fn):
@wraps(fn)
def decorated_view(*args, **kwargs):
if not config.frontend.authentication.enabled:
if not config.frontend.authentication.enabled or no_role_needed:
return fn(*args, **kwargs)
return original_decorator(*roles)(fn)(*args, **kwargs)

Expand Down