def ShareWorkflow(self, workflow_id, user_name, permissions): workflow = self.GetWorkflow(workflow_id) user = User.objects.get(username=user_name) Workflows.ShareWorkflow(self.user, workflow, user, Run=permissions["Run"], Export=permissions["Export"], Publish=permissions["Publish"], Edit=permissions["Edit"], Admin=permissions["Admin"] )
def UpdateWorkflow(self, workflow_id, workflow): with transaction.atomic(): w = Workflows.UpdateWorkflow(self.user, workflow_id, workflow["WorkflowName"], workflow["Category"], workflow["ShortDescription"]) version = self.GetWorkflowVersion(w, 'dev') version = WorkflowVersions.UpdateWorkflowVersion(self.user, version, workflow["ShortDescription"], workflow["LongDescription"]) return w
def AddWorkflow(self, workflow): with transaction.atomic(): #create the workflow w = Workflows.AddWorkflow(self.user, workflow["WorkflowName"], workflow["Category"], workflow["Description"], False) #create the development workflow version version = WorkflowVersions.AddWorkflowVersion(self.user, w, "dev", workflow["Description"], "") return version
def UpdateWorkflowAvailability(self, worfklow_id, publicInd): workflow = self.GetWorkflow(worfklow_id) return Workflows.UpdateAvailability(self.user, workflow, publicInd)
def UnshareWorkflow(self, workflow_id, user_name): workflow = self.GetWorkflow(workflow_id) user = User.objects.get(username=user_name) Workflows.UnshareWorkflow(self.user, workflow, user)
def DeleteWorkflow(self, workflow_id): Workflows.DeleteWorkflow(self.user, workflow_id)
def GetWorkflow(self, workflow_id): return Workflows.GetWorkflow(self.user, workflow_id)
def GetWorkflows(self, ): return Workflows.GetWorkflows(self.user)