mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Check a permission matches an existing route before it is allowed to be created.
This commit is contained in:
1 parent
183033dad8
commit
9df586d5d5
3 files changed
+49
-8
No files matched your search
@@ -61,11 +61,7 @@ async def get_current_active_user(
|
||||
)
|
||||
|
||||
# remove the prefix (e.g. "/v3") from URL path
|
||||
match = re.search(r"^(/v[0-9]+).*", request.url.path)
|
||||
if match:
|
||||
path = request.url.path[len(match.group(1)):]
|
||||
else:
|
||||
path = request.url.path
|
||||
path = re.sub(r"^/v[0-9]", "", request.url.path)
|
||||
|
||||
# special case: always authorize access to the "/users/me" endpoint
|
||||
if path == "/users/me":
|
||||
|
||||
Reference in new issue
Block a user