Quintiq file version 2.0
#parent: SplitterWnd/ButtonAssignAll
Response OnClick () id:Response_SplitterWnd_ButtonAssignAll_OnClick
{
  #keys: '[11660.0.327679474]'
  Body:
  [*
    // Assign all User Group to Scenario
    alluserdefinitions := selectset( Domain.UserGroupDefinitions(),
                                     Elements,
                                     el,
                                     MPDomainHandler::IsRole( el )
                                     and not el.Name()='Administrator' 
                                     and not exists( Dialog.Data(), ScenarioAuthorization, sa, sa.Name() = el.Name() ),
                                     true );
    Dialog.AssignUserGroup( alluserdefinitions );
    
    
    Dialog.RefreshAllUserGroups();
  *]
  DefinitionID => /SplitterWnd/Responsedef_SplitterWnd_ButtonAssignAll_OnClick
  Precondition:
  [*
    alluserdefinitions := selectset( Domain.UserGroupDefinitions(),
                                     Elements,
                                     el,
                                     MPDomainHandler::IsRole( el )
                                     and not el.Name()='Administrator' );
                                     
    return alluserdefinitions.Elements( relsize ) > Dialog.Data().ScenarioAuthorization( relsize );
  *]
}
