In a Gen EJB/EJB Web Service the Assemble step includes builds the .ear file which contains one or more SERVER_MANAGER.jar files.
Inside each SERVER_MANAGER.jar in the META-INF folder there is a file ejb-jar.xml.
By default it contains an empty assembly-descriptor section. <assembly-descriptor>
</assembly-descriptor>
It is required to replace that with this: <assembly-descriptor>
<security-role>
<role-name>GenAcquisitionSecurityRole</role-name>
</security-role>
<method-permission>
<role-name>GenAcquisitionSecurityRole</role-name>
<method>
<ejb-name>PSTEPNAME</ejb-name>
<method-name>*</method-name>
</method>
</method-permission>
</assembly-descriptor>
How can the Build Tool scripts be changed to enable this to be done automatically?
Gen 8.6 EJB/EJB Web Service
This can only be achieved via a customization.
Gen Support developed the following solution.
NOTE: This solution assumes 1 Procedure Step (PStep) per SERVER MANAGER.
model_name.ief\java\SERVER_NAME\META-INF
".{* I N I T I A L I Z A T I O N A N D H E A D E R S *}
echo.
echo =====================EARFILE Assemble Information============
{[FOREACH]} EARFILE AS earfile
echo EAR File: {earfile.EARFILE}.ear
{[IF]} EQUAL "{EJB_PRESENT}" "YES"
echo EJB Modules:
{[FOREACH]} MODULE AS module
{[FOREACH]} EXECDEF AS execdef
{[FOREACH]} EXECUNIT AS execunit
echo {execunit.MEMBER}
echo Updating ejb-jar.xml file
powershell.exe -FILE "%GEN86%\Gen\bt\scripts\get_pstepname_from_ejb_jar_xml.ps1" "{LOC.CODE_OBJ}{execunit.MEMBER}/META-INF/ejb-jar.xml"
{[ENDFOR]}
{[ENDFOR]}
{[ENDFOR]}
{[ENDIF]}
...
@echo off
setlocal
REM
REM Copyright (C) 2016 CA. All rights reserved.
REM
set COPYCMD=/Y
C:
CD "C:\Users\Administrator\Documents\CA\Gen 8.6\Models\cstest99.ief\java\\."
echo.
echo =====================EARFILE Assemble Information============
echo EAR File: cstest99.ear
echo EJB Modules:
echo S1
echo Updating ejb-jar.xml file
powershell.exe -FILE "%GEN86%\Gen\bt\scripts\get_pstepname_from_ejb_jar_xml.ps1" "C:\Users\Administrator\Documents\CA\Gen 8.6\Models\cstest99.ief\java\\S1/META-INF/ejb-jar.xml"
echo S2
echo Updating ejb-jar.xml file
powershell.exe -FILE "%GEN86%\Gen\bt\scripts\get_pstepname_from_ejb_jar_xml.ps1" "C:\Users\Administrator\Documents\CA\Gen 8.6\Models\cstest99.ief\java\\S2/META-INF/ejb-jar.xml"
echo Additional Files:
echo - EAR file:
echo.
echo ===========================================================
...