|
@@ -1499,9 +1499,12 @@ String function cmd_transformation_execute(transformation_name : String, source_
|
|
|
source_model_ID = get_entry_id(source_model_name)
|
|
|
if (source_model_ID != ""):
|
|
|
if (allow_read(current_user_id, source_model_ID)):
|
|
|
- // Check for conformance to the requested metamodel
|
|
|
- dict_add(inputs, assoc_name, source_model_name)
|
|
|
- continue!
|
|
|
+ if (read_type(core, source_model_ID) != "Folder"):
|
|
|
+ // Check for conformance to the requested metamodel
|
|
|
+ dict_add(inputs, assoc_name, source_model_name)
|
|
|
+ continue!
|
|
|
+ else:
|
|
|
+ return "Not a model: " + source_model_name!
|
|
|
else:
|
|
|
return "Read permission denied to: " + source_model_name!
|
|
|
else:
|
|
@@ -1533,11 +1536,15 @@ String function cmd_transformation_execute(transformation_name : String, source_
|
|
|
return "Write permission denied to: " + get_foldername(target_model_name)!
|
|
|
else:
|
|
|
// Already exists, so we need to check for write access
|
|
|
- if (allow_write(current_user_id, get_entry_id(target_model_name))):
|
|
|
- dict_add(output_map, assoc_name, read_attribute(core, readAssociationDestination(core, target), "name"))
|
|
|
- dict_add(outputs, assoc_name, target_model_name)
|
|
|
+ if (read_type(core, get_entry_id(target_model_name)) == "Folder"):
|
|
|
+ // Is a folder, so reject
|
|
|
+ return "Not a model: " + target_model_name!
|
|
|
else:
|
|
|
- return "Write permission denied to: " + target_model_name!
|
|
|
+ if (allow_write(current_user_id, get_entry_id(target_model_name))):
|
|
|
+ dict_add(output_map, assoc_name, read_attribute(core, readAssociationDestination(core, target), "name"))
|
|
|
+ dict_add(outputs, assoc_name, target_model_name)
|
|
|
+ else:
|
|
|
+ return "Write permission denied to: " + target_model_name!
|
|
|
|
|
|
diff = set_difference(dict_keys(target_models), dict_keys(outputs))
|
|
|
if (set_len(diff) > 0):
|
|
@@ -1771,6 +1778,10 @@ String function transformation_add(source_models : Element, target_models : Elem
|
|
|
if (allow_read(current_user_id, model_id)):
|
|
|
if (bool_not(dict_in(source, key))):
|
|
|
dict_add(source, key, model_id)
|
|
|
+
|
|
|
+ if (read_type(core, model_id) == "Folder"):
|
|
|
+ return "Not a model: " + name!
|
|
|
+
|
|
|
mm = get_full_model(model_id, get_entry_id("formalisms/SimpleClassDiagrams"))
|
|
|
if (element_eq(mm, read_root())):
|
|
|
return "Type cannot be typed as formalisms/SimpleClassDiagrams: " + key!
|
|
@@ -1796,6 +1807,9 @@ String function transformation_add(source_models : Element, target_models : Elem
|
|
|
if (model_id != ""):
|
|
|
if (allow_read(current_user_id, model_id)):
|
|
|
if (bool_not(dict_in(target, key))):
|
|
|
+ if (read_type(core, model_id) == "Folder"):
|
|
|
+ return "Not a model: " + name!
|
|
|
+
|
|
|
if (dict_in(source, key)):
|
|
|
if (value_neq(source[key], model_id)):
|
|
|
return "Input and output signature differ for same key: " + key!
|
|
@@ -1917,6 +1931,9 @@ String function cmd_transformation_add_MT(source_models : Element, target_models
|
|
|
if (model_id != ""):
|
|
|
if (allow_read(current_user_id, model_id)):
|
|
|
// Check whether or not it is formalisms/SimpleClassDiagrams
|
|
|
+ if (read_type(core, model_id) == "Folder"):
|
|
|
+ return "Not a model: " + name!
|
|
|
+
|
|
|
mm = get_full_model(model_id, get_entry_id("formalisms/SimpleClassDiagrams"))
|
|
|
if (element_neq(mm, read_root())):
|
|
|
if (bool_not(dict_in(source, key))):
|
|
@@ -1938,6 +1955,9 @@ String function cmd_transformation_add_MT(source_models : Element, target_models
|
|
|
model_id = get_entry_id(name)
|
|
|
if (model_id != ""):
|
|
|
if (allow_read(current_user_id, model_id)):
|
|
|
+ if (read_type(core, model_id) == "Folder"):
|
|
|
+ return "Not a model: " + name!
|
|
|
+
|
|
|
mm = get_full_model(model_id, get_entry_id("formalisms/SimpleClassDiagrams"))
|
|
|
if (element_neq(mm, read_root())):
|
|
|
if (bool_not(dict_in(target, key))):
|