601,100
562,"VIEW"
586,"}CellSecurity_plan_BudgetPlan"
585,"}CellSecurity_plan_BudgetPlan"
564,
565,"hdlITYA=aXVZ0>^Uf9^=h95`T[?@`mW@^D@dP1qeGChysxRHEG^t7rOzUyu44xJl@N209kEc1Lwprgy]sfWi2XKu^Ei>BVa\rTR;[AlP@TDNto7c=\gHQNj1xKdMbbhfxP6f\lY=>;q[i@pyQ32[UQ^I;1cP@6vjuNVyhqFvXOhlwCWf\:;au\xNR\bkOj0^47p]Uz]>"
559,0
593,
594,
595,
597,
598,
596,
800,
801,
566,0
567,","
588,"."
589,
568,""""
570,}sm_placeholder_view
571,
569,0
592,0
599,1000
560,6
pSingleTask
pAncestors
pVersion
pPlan
pUnique
pAction
561,6
2
2
2
2
2
2
590,6
pSingleTask,""
pAncestors,""
pVersion,""
pPlan,""
pUnique,""
pAction,""
637,6
pSingleTask,Single Task
pAncestors,Ancestors (0
pVersion,Version
pPlan,Plan
pUnique,Unique String
pAction,Action (Update
577,12
plan_version
plan_business_unit
plan_department
plan_chart_of_accounts
plan_exchange_rates
plan_method
plan_time
vGroups
Value
NVALUE
SVALUE
VALUE_IS_STRING
578,12
2
2
2
2
2
2
2
2
2
1
2
1
579,12
1
2
3
4
5
6
7
8
9
0
0
0
580,12
0
0
0
0
0
0
0
0
0
0
0
0
581,12
0
0
0
0
0
0
0
0
0
0
0
0
582,9
VarType=32	ColType=827	
VarType=32	ColType=827	
VarType=32	ColType=827	
VarType=32	ColType=827	
VarType=32	ColType=827	
VarType=32	ColType=827	
VarType=32	ColType=827	
VarType=32	ColType=827	
VarType=32	ColType=827	
572,153

#****GENERATED STATEMENTS START****
#****GENERATED STATEMENTS FINISH****

vObjectPrefix = attrs('}sm_controls', 'subman_object_prefix', 'value');
vObjectSeparator = attrs('}sm_controls', 'subman_object_separator', 'value');

vCube = '}CellSecurity_plan_budgetplan';


vTempView = vObjectPrefix | 'sm_security' | vObjectSeparator | pUnique;

#
# Clean up and the recreate the uniquely named temporary view
#
VIEWDESTROY(vCube, vTempView);
VIEWCREATE(vCube, vTempView);
ViewSetSkipCalcs(vCube, vTempView, 0);
ViewSetSkipZeroes(vCube, vTempView, 0);
ViewSetSkipRuleValues(vCube, vTempView, 0);

#
# Create a temporary subset of the chosen version and apply the subset to the temporary view
#
SUBSETDESTROY(pPlan, vTempView);
SUBSETCREATE(pPlan, vTempView);
SUBSETELEMENTINSERT(pPlan, vTempView, pVersion, 1);
VIEWSUBSETASSIGN(vCube, vTempView, pPlan, vTempView);

#
# if the process is working on a single task, scan the task attributes to build up a focused temporary view
#
if (pSingleTask @<> '');

vTaskDimension = vObjectPrefix | 'sm_versiontasks' | vObjectSeparator | pPlan  | vObjectSeparator | pVersion;

vOwnerSetting = '';
vDelegatorSetting = '';
vTaskStatus = ATTRS(vTaskDimension, pSingleTask, 'Status');
vOwnerGroup = ATTRS(vTaskDimension, pSingleTask, 'Owner Group');
if (vTaskStatus @<> '' & vOwnerGroup @<> '');
vOwnerSetting = ATTRS(vObjectPrefix | 'sm_task_status', vTaskStatus, 'Owner Security');
vDelegatorSetting = ATTRS(vObjectPrefix | 'sm_task_status', vTaskStatus, 'Delegator Security');
endif;
if (vOwnerSetting @= '');
processbreak;
endif;

vBindIndex = 1;
while (vBindIndex <= 16);

vDimSet = 'dimension' | trim(str(vBindIndex, 2, 0));
vDimIx = DIMIX('}ElementAttributes_' | vTaskDimension, vDimSet );
if (vDimIx > 0);

vDim = ATTRS(vTaskDimension, pSingleTask, vDimSet );
if (vDim @<> '');
vSubSet = 'subset' | trim(str(vBindIndex, 2, 0));
vSub = ATTRS(vTaskDimension, pSingleTask, vSubSet );
if (vSub @<> '');
VIEWSUBSETASSIGN(vCube, vTempView, vDim, vSub);
else;
vEleSet = 'element' | trim(str(vBindIndex, 2, 0));
vElement = ATTRS(vTaskDimension, pSingleTask, vEleSet );
if (vElement  @<> '');
vSub = vTempView;
SUBSETDESTROY(vDim, vSub);
SUBSETCREATE(vDim, vSub);
SUBSETELEMENTINSERT(vDim, vSub, vElement,1);
VIEWSUBSETASSIGN(vCube, vTempView, vDim, vSub);
endif;
endif;
endif;
endif;

vBindIndex = vBindIndex + 1;
end;

vDim = '}Groups';
SUBSETDESTROY(vDim , vTempView);
SUBSETCREATE(vDim, vTempView);
SUBSETELEMENTINSERT(vDim, vTempView, vOwnerGroup,1);

#
# if pAncestors is:
#   0 do not set security for the task's ancestor nodes
#   1 set security on the task's immediate parent
#   N set security on all of the task's ancestors
#
if (ELPARN(vTaskDimension, pSingleTask) > 0 & pAncestors @<> '0');
vDelegatorTask = ELPAR(vTaskDimension, pSingleTask, 1);
vDelegatorGroup = ATTRS(vTaskDimension, vDelegatorTask, 'owner group');
if (vDelegatorGroup @<> vOwnerGroup & vDelegatorGroup @<> '');
SUBSETELEMENTINSERT(vDim, vTempView, vDelegatorGroup,1);
endif;

if (pAncestors @= 'N');

while (ELPARN(vTaskDimension, vDelegatorTask) > 0);
vDelegatorTask = ELPAR(vTaskDimension,  vDelegatorTask, 1);
vDelegatorGroup = ATTRS(vTaskDimension, vDelegatorTask, 'owner group');
if (vDelegatorGroup @<> vOwnerGroup & vDelegatorGroup @<> '');
SUBSETELEMENTINSERT(vDim, vTempView, vDelegatorGroup,1);
endif;
end;

endif;
endif;

VIEWSUBSETASSIGN(vCube, vTempView, vDim, vTempView);

endif;

VIEWZEROOUT(vCube, vTempView);
if (pAction @= 'CLEAR');
VIEWDESTROY(vCube, vTempView);


vBindIndex = 1;
while (vBindIndex <= 16);

vDimSet = 'dimension' | trim(str(vBindIndex, 2, 0));
vDimIx = DIMIX('}ElementAttributes_' | vTaskDimension, vDimSet );
if (vDimIx > 0);

vDim = ATTRS(vTaskDimension, pSingleTask, vDimSet );
if (vDim @<> '');
vSubSet = 'subset' | trim(str(vBindIndex, 2, 0));
vSub = ATTRS(vTaskDimension, pSingleTask, vSubSet );
if (vSub @= '');
vEleSet = 'element' | trim(str(vBindIndex, 2, 0));
vElement = ATTRS(vTaskDimension, pSingleTask, vEleSet );
if (vElement  @<> '');
vSub = vTempView;
SUBSETDESTROY(vTaskDimension, vSub);
endif;
endif;
endif;
endif;

vBindIndex = vBindIndex + 1;
end;

SUBSETDESTROY('}Groups' , vTempView);

SUBSETDESTROY(pPlan, vTempView);
processbreak;
else;
DatasourceCubeview = vTempView;
endif;



573,3

#****GENERATED STATEMENTS START****
#****GENERATED STATEMENTS FINISH****
574,13

#****GENERATED STATEMENTS START****
#****GENERATED STATEMENTS FINISH****


if (vGroups @= vOwnerGroup);
CellPuts(vOwnerSetting, vCube, plan_Version, plan_business_unit, plan_Department, plan_chart_of_accounts, plan_exchange_Rates, 
plan_Method, plan_time,vOwnerGroup);
else;
CellPuts(vDelegatorSetting , vCube, plan_Version, plan_business_unit, plan_Department, plan_chart_of_accounts, plan_exchange_Rates, 
plan_Method, plan_time, vGroups);
endif;

575,39

#****GENERATED STATEMENTS START****
#****GENERATED STATEMENTS FINISH****



VIEWDESTROY(vCube, vTempView);


vBindIndex = 1;
while (vBindIndex <= 16);

vDimSet = 'dimension' | trim(str(vBindIndex, 2, 0));
vDimIx = DIMIX('}ElementAttributes_' | vTaskDimension, vDimSet );
if (vDimIx > 0);

vDim = ATTRS(vTaskDimension, pSingleTask, vDimSet );
if (vDim @<> '');
vSubSet = 'subset' | trim(str(vBindIndex, 2, 0));
vSub = ATTRS(vTaskDimension, pSingleTask, vSubSet );
if (vSub @= '');
vEleSet = 'element' | trim(str(vBindIndex, 2, 0));
vElement = ATTRS(vTaskDimension, pSingleTask, vEleSet );
if (vElement  @<> '');
vSub = vTempView;
SUBSETDESTROY(vTaskDimension, vSub);
endif;
endif;
endif;
endif;

vBindIndex = vBindIndex + 1;
end;

SUBSETDESTROY('}Groups' , vTempView);

SUBSETDESTROY(pPlan, vTempView);


576,CubeAction=1511	DataAction=1503	CubeLogChanges=0	
638,1
804,0
900,
901,
902,
903,
906,
907,
908,
904,0
905,0
909,0
910,0
911,
912,
913,
914,
915,
916,
