def init_factory(self, role, model, parent): """Initialize RBAC factory with propagated Cycle Task Assignees role. Args: role: Global Custom role that user have (Creator/Reader/Editor). model: Model name for which factory should be got. parent: Model name in scope of which objects should be installed. Returns: Initialized RBACFactory object. """ self.setup_people() ctask_assignees_acr = all_models.AccessControlRole.query.filter_by( name="Task Assignees", object_type="CycleTaskGroupObjectTask", ).first() rbac_factory = rbac_factories.get_factory(model) return rbac_factory(self.people[role].id, ctask_assignees_acr, parent)
def init_factory(self, role, model, parent): """Initialize RBAC factory with propagated Workflow Admin role. Args: role: Global Custom role that user have (Creator/Reader/Editor). model: Model name for which factory should be got. parent: Model name in scope of which objects should be installed. Returns: Initialized RBACFactory object. """ self.setup_people() wf_admin_acr = all_models.AccessControlRole.query.filter_by( name="Admin", object_type="Workflow", ).first() rbac_factory = rbac_factories.get_factory(model) return rbac_factory(self.people[role].id, wf_admin_acr, parent)