Browse Source

Document some more functions of the wrapper

Yentl Van Tendeloo 7 years ago
parent
commit
4e72712423
1 changed files with 34 additions and 2 deletions
  1. 34 2
      doc/wrappers.rst

+ 34 - 2
doc/wrappers.rst

@@ -498,13 +498,45 @@ Processes
      >>> process_execute("models/pm_powerwindow", {}, {"models/refine_plant": refine_plant, "models/refine_control": refine_control, "models/refine_query": refine_query})
 
 .. function:: process_signature(process_name)
-   TODO
+   
+   Fetch the process signature, specifying the list of all possible models and their metamodel.
+   The returned dictionary works in two directions, as it is used for retrieving models and storing them again.
+   All *Data* instances are listed here, with their *name* attribute as key and their *type* attribute as value.
+
+   Examples:
+
+   * To fetch all data artefacts from the process *pn_reachability*.
+
+     >>> process_signature("pn_reachability")
+     {"pn": "users/user/test/PetriNet", "reachability": "users/user/test/ReachabilityGraph"}
 
 User Access Control
 ^^^^^^^^^^^^^^^^^^^
 
 .. function:: read_permissions(model_name)
-   TODO
+   
+   Read the permissions of the current user for a specific model.
+   In contrast to the *model_list_full* operation, which gives general permission information (e.g., owner and permissions for owner), this operation gives tailored information for this specific user (i.e., none, read, or write).
+   As such, this operation does the necessary resolution of group membership and owning group deduction.
+   The result is a string containing letters indicating permissions: "R" for read and "W" for write.
+   If the model even cannot be read, the string is empty.
+
+   Examples:
+
+   * To determine the permissions for the *users/user/my_pn* model, which we own, for which we have read and write permissions.
+
+     >>> read_permissions("user/user/my_pn")
+     "RW"
+
+   * To determine the permissions for the *formalisms/SimpleClassDiagrams" metamodel, for which we have read permissions, but no write permissions.
+
+     >>> read_permissions("formalisms/SimpleClassDiagrams")
+     "R"
+
+   * To determine the permissions of the *administration/core* model, which we are not allowed to read or write.
+
+     >>> read_permissions("administration/core")
+     ""
 
 .. function:: permission_modify(model_name, permissions)