Fix any user can recieve all api keys

This commit is contained in:
Andrew 2022-06-18 16:20:57 -04:00
parent 5bb17eae33
commit fd0da1ef20

View File

@ -1926,6 +1926,12 @@ class PanelHandler(BaseHandler):
self.redirect("/panel/error?error=Invalid Key ID")
return
if key.user_id != exec_user["user_id"]:
self.redirect(
"/panel/error?error=You are not authorized to access this key."
)
return
self.controller.management.add_to_audit_log(
exec_user["user_id"],
f"Generated a new API token for the key {key.name} "