Tuesday, April 28, 2009

Essbase Security Maxl Script

Here is a simple example of how to maintain Essbase security in a maxl statement:

spool on to Security.log;
login admin password on localhost;
set timestamp on;


/*-------------------------------------------------------------------------------------------------------------*/
/* READ ACCESS TO WEST AND ITS DESCENDANTS ONLY */
/*-------------------------------------------------------------------------------------------------------------*/
create or replace filter Sample.Basic.'Read_WestMarket_Filter' READ on '@IDESCENDANTS("West")';


/*-------------------------------------------------------------------------------------------------------------*/
/* CREATE GROUP(S) */
/*-------------------------------------------------------------------------------------------------------------*/
create or replace group 'Read_WestMarket_Group';


/*-------------------------------------------------------------------------------------------------------------*/
/* GRANT FILTER ACCESS TO GROUP(S) */
/*-------------------------------------------------------------------------------------------------------------*/
grant filter TestApp.TestDb.'Read_WestMarket_Filter' to 'Read_WestMarket_Group';


/*-------------------------------------------------------------------------------------------------------------*/
/* ADD USERS TO GROUP(S) */
/*-------------------------------------------------------------------------------------------------------------*/
alter user testuser1 add to group 'Read_WestMarket_Group';


logout;
spool off;
exit;

Create all of your filters in one section, then create all of your groups, then grant the filters to the groups and finally put the users in those groups.

No comments: