示例#1
0
 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)
示例#2
0
 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)
示例#3
0
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)
示例#4
0
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)
示例#5
0
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)
示例#6
0
 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))
示例#7
0
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)
示例#8
0
 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))
示例#9
0
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)
示例#10
0
def deactivate(group):
    """Perform any actions required to deactivate a group.
    """
    utils.unset_group_local_role(group)
示例#11
0
 def _deactivate(context):
     utils.unset_group_local_role(context)
示例#12
0
def _group_deactivate(info, context):
    utils.unset_group_local_role(context)