|
@@ -624,53 +624,77 @@ def process_execute(process_name, prefix, callbacks):
|
|
|
_input("exit")
|
|
|
mode = MODE_MODELLING
|
|
|
|
|
|
-def permission_modify():
|
|
|
+def permission_modify(model_name, permissions):
|
|
|
"""Modify permissions of a model."""
|
|
|
- raise NotImplementedError()
|
|
|
+ _goto_mode(MODE_MODELLING)
|
|
|
+ _input(["permission_modify", model_name, permissions])
|
|
|
+ _handle_output("Success")
|
|
|
|
|
|
-def permission_owner():
|
|
|
+def permission_owner(model_name, owner):
|
|
|
"""Modify the owning user of a model."""
|
|
|
- raise NotImplementedError()
|
|
|
+ _goto_mode(MODE_MODELLING)
|
|
|
+ _input(["permission_owner", model_name, owner])
|
|
|
+ _handle_output("Success")
|
|
|
|
|
|
-def permission_group():
|
|
|
+def permission_group(model_name, group):
|
|
|
"""Modify the owning group of a model."""
|
|
|
- raise NotImplementedError()
|
|
|
+ _goto_mode(MODE_MODELLING)
|
|
|
+ _input(["permission_group", model_name, group])
|
|
|
+ _handle_output("Success")
|
|
|
|
|
|
-def group_create():
|
|
|
+def group_create(group_name):
|
|
|
"""Create a new group."""
|
|
|
- raise NotImplementedError()
|
|
|
+ _goto_mode(MODE_MODELLING)
|
|
|
+ _input(["group_create", group_name])
|
|
|
+ _handle_output("Success")
|
|
|
|
|
|
-def group_delete():
|
|
|
+def group_delete(group_name):
|
|
|
"""Delete a group of which you are an owner."""
|
|
|
- raise NotImplementedError()
|
|
|
+ _goto_mode(MODE_MODELLING)
|
|
|
+ _input(["group_delete", group_name])
|
|
|
+ _handle_output("Success")
|
|
|
|
|
|
-def group_owner_add():
|
|
|
+def group_owner_add(group_name, user_name):
|
|
|
"""Add a new owning user to a group you own."""
|
|
|
- raise NotImplementedError()
|
|
|
+ _goto_mode(MODE_MODELLING)
|
|
|
+ _input(["owner_add", group_name, user_name])
|
|
|
+ _handle_output("Success")
|
|
|
|
|
|
-def group_owner_delete():
|
|
|
+def group_owner_delete(group_name, user_name):
|
|
|
"""Delete an owning user to a group you own."""
|
|
|
- raise NotImplementedError()
|
|
|
+ _goto_mode(MODE_MODELLING)
|
|
|
+ _input(["owner_delete", group_name, user_name])
|
|
|
+ _handle_output("Success")
|
|
|
|
|
|
-def group_join():
|
|
|
+def group_join(group_name, user_name):
|
|
|
"""Add a new user to a group you own."""
|
|
|
- raise NotImplementedError()
|
|
|
+ _goto_mode(MODE_MODELLING)
|
|
|
+ _input(["group_join", group_name, user_name])
|
|
|
+ _handle_output("Success")
|
|
|
|
|
|
-def group_kick():
|
|
|
+def group_kick(group_name, user_name):
|
|
|
"""Delete a user from a group you own."""
|
|
|
- raise NotImplementedError()
|
|
|
+ _goto_mode(MODE_MODELLING)
|
|
|
+ _input(["group_kick", group_name, user_name])
|
|
|
+ _handle_output("Success")
|
|
|
|
|
|
def group_list():
|
|
|
"""List existing groups."""
|
|
|
- raise NotImplementedError()
|
|
|
+ _goto_mode(MODE_MODELLING)
|
|
|
+ _input(["group_list"])
|
|
|
+ _handle_output("Success")
|
|
|
|
|
|
-def admin_promote():
|
|
|
+def admin_promote(user_name):
|
|
|
"""Promote a user to admin status."""
|
|
|
- raise NotImplementedError()
|
|
|
+ _goto_mode(MODE_MODELLING)
|
|
|
+ _input(["admin_promote", user_name])
|
|
|
+ _handle_output("Success")
|
|
|
|
|
|
def admin_demote():
|
|
|
"""Demote a user from admin status."""
|
|
|
- raise NotImplementedError()
|
|
|
+ _goto_mode(MODE_MODELLING)
|
|
|
+ _input(["admin_demote", user_name])
|
|
|
+ _handle_output("Success")
|
|
|
|
|
|
# Actual operations on the model
|
|
|
def element_list(model_name):
|