mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Move verification check from plugin to the import of containers.
part of CURA-6856
This commit is contained in:
parent
298eb27c7f
commit
5908ff60ee
1 changed files with 1 additions and 13 deletions
|
@ -15,9 +15,8 @@ import UM.Dictionary
|
||||||
from UM.Settings.InstanceContainer import InstanceContainer
|
from UM.Settings.InstanceContainer import InstanceContainer
|
||||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||||
from UM.ConfigurationErrorMessage import ConfigurationErrorMessage
|
from UM.ConfigurationErrorMessage import ConfigurationErrorMessage
|
||||||
from UM.Trust import Trust
|
|
||||||
|
|
||||||
from cura.CuraApplication import ApplicationMetadata, CuraApplication
|
from cura.CuraApplication import CuraApplication
|
||||||
from cura.Machines.ContainerTree import ContainerTree
|
from cura.Machines.ContainerTree import ContainerTree
|
||||||
from cura.Machines.VariantType import VariantType
|
from cura.Machines.VariantType import VariantType
|
||||||
|
|
||||||
|
@ -471,17 +470,6 @@ class XmlMaterialProfile(InstanceContainer):
|
||||||
|
|
||||||
## Overridden from InstanceContainer
|
## Overridden from InstanceContainer
|
||||||
def deserialize(self, serialized, file_name = None):
|
def deserialize(self, serialized, file_name = None):
|
||||||
|
|
||||||
# NOTE: In an enterprise environment, IT might not trust every material package the user installs.
|
|
||||||
# In that case, check if this package is trusted first, and return prematurely if not.
|
|
||||||
if file_name is not None and ApplicationMetadata.CuraIsEnterpriseVersion:
|
|
||||||
from UM.Application import Application
|
|
||||||
install_prefix = os.path.abspath(Application.getInstallPrefix())
|
|
||||||
common_path = os.path.commonpath([install_prefix, file_name])
|
|
||||||
if common_path is None or not common_path.startswith(install_prefix):
|
|
||||||
if not Trust.getInstance().signedFileCheck(file_name):
|
|
||||||
raise Exception("Trust-check failed for material file {0}.".format(file_name))
|
|
||||||
|
|
||||||
containers_to_add = []
|
containers_to_add = []
|
||||||
# update the serialized data first
|
# update the serialized data first
|
||||||
from UM.Settings.Interfaces import ContainerInterface
|
from UM.Settings.Interfaces import ContainerInterface
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue