mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Allow changing location only for local usage
This commit is contained in:
1 parent
4f2764c0b4
commit
017c5ac9f6
3 files changed
+34
-25
No files matched your search
@@ -20,6 +20,7 @@ import os
|
||||
import tempfile
|
||||
import shutil
|
||||
from uuid import UUID, uuid4
|
||||
from ..config import Config
|
||||
|
||||
|
||||
class Project:
|
||||
@@ -46,6 +47,10 @@ class Project:
|
||||
self._location = location
|
||||
if location is None:
|
||||
self._location = tempfile.mkdtemp()
|
||||
else:
|
||||
config = Config.instance().get_section_config("Server")
|
||||
if config.get("local", False) is False:
|
||||
raise aiohttp.web.HTTPForbidden(text="You are not allowed to modifiy the project directory location")
|
||||
|
||||
self._temporary = temporary
|
||||
self._vms = set()
|
||||
|
||||
Reference in new issue
Block a user