How to create application roles automatically

Sometimes it is necessary to create application roles in Enterprise Manager via script. This is not very difficult.

First create a file with your application roles you want to create. Use the following syntax:

createAppRole("obi","APPROLE1")
createAppRole("obi","APPROLE2")

Then create a second file which assign groups to your application roles:

grantAppRole("obi","APPROLE1","weblogic.security.principal.WLSGroupImpl","GROUP1")
grantAppRole("obi","APPROLE2","weblogic.security.principal.WLSGroupImpl","GROUP2")

Now log in to Weblogic Scripting Tool (WLST), connect to your local domain and exeute boot files:

/wlst.sh
# connect to your local domain with weblogic administrator
connect() 
# create application roles
execfile(createapproles.py)
# after this finished assign groups
execfile(grantapproles.py)
This entry was posted in OBIEE. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>