def on_create(self): """Application-internal creation logic i.e. logic NOT subject to config. """ # requires self db id to have been updated from bungeni.core.workflows import utils utils.assign_role_owner_to_login(self) utils.unset_group_local_role(self)
def on_create(self): """Application-internal creation logic i.e. logic NOT subject to config. """ # requires self db id to have been updated from bungeni.core.workflows import utils utils.assign_ownership(self) utils.unset_group_local_role(self)
def deactivate(group): """Perform any actions required to deactivate a group. When a group is deactivated the group role is revoked to the group principal (and by virtue of membership, also to each active member of the group) on target context as specified by this group's privilege_extent setting. """ utils.unset_group_local_role(group)
def _group_dissolved(context): """ when a group is dissolved all members of this group get the end date of the group (if they do not have one yet) and there active_p status gets set to False""" dbutils.deactivateGroupMembers(context) groups = dbutils.endChildGroups(context) utils.dissolveChildGroups(groups, context) utils.unset_group_local_role(context)
def _group_dissolve(info, context): """ when a group is dissolved all members of this group get the end date of the group (if they do not have one yet) and there active_p status gets set to False""" dbutils.deactivateGroupMembers(context) groups = dbutils.endChildGroups(context) utils.dissolveChildGroups(groups, context) utils.unset_group_local_role(context)
def _do_save(self, data): group_role_changed = False prm = IPrincipalRoleMap(get_group_privilege_extent_context(self.context)) if (data["group_role"] != self.context.group_role): if prm.getSetting(self.context.group_role, self.context.principal_name) == Allow: group_role_changed = True unset_group_local_role(self.context) formlib.form.applyChanges(self.context, self.form_fields, data) if group_role_changed: set_group_local_role(self.context) notify(ObjectModifiedEvent(self.context))
def dissolve(group): """Perform any actions required to dissolve a group. When a group is dissolved all members of this group get the end date of the group (if they do not have one yet) and there active_p status gets set to False. """ from bungeni.core.workflows import dbutils dbutils.deactivateGroupMembers(group) groups = dbutils.endChildGroups(group) utils.dissolveChildGroups(groups, group) utils.unset_group_local_role(group)
def _do_save(self, data): group_role_changed = False prm = IPrincipalRoleMap(get_group_context(self.context)) if (data["group_role"] != self.context.group_role): if (prm.getSetting(self.context.group_role, self.context.principal_name) == Allow): group_role_changed = True unset_group_local_role(self.context) formlib.form.applyChanges(self.context, self.form_fields, data) if group_role_changed: set_group_local_role(self.context) notify(ObjectModifiedEvent(self.context))
def dissolve(group): """Perform any actions required to dissolve a group - typically set as an action on group workflow state "dissolved". When a group is dissolved: - all members of this group get the end date of the group (if they do not have one yet) and there active_p status gets set to False. - any child group is ended and dissolved. """ from bungeni.core.workflows import dbutils dbutils.deactivate_group_members(group) for ended_child_group in dbutils.end_child_groups(group): # !+GROUP_DISSOLVE assumes that workflow of EVERY child group type has: # - a state "active" AND a state "dissolved" AND # - a transition from first to second AND # - that the semantic meaning of the state "dissolved" is indeed # dissolution of the group... # should probably replace with a GroupType.dissolve() method that # knows how to dissolve itself and/or as dissolve feature parameters IWorkflowController(ended_child_group).fireTransition( "active-dissolved", check_security=False) utils.unset_group_local_role(group)
def deactivate(group): """Perform any actions required to deactivate a group. """ utils.unset_group_local_role(group)
def _deactivate(context): utils.unset_group_local_role(context)
def _group_deactivate(info, context): utils.unset_group_local_role(context)