
Would like to share few tips and tricks while utilizing Analytic Application in SAC for planning scenarios. This helps us to improve the performance and also helps to build a flexible solution in Analytics Application.
Analytic Application Security
/* Getting Project Managers from Master Data Model*/
var pm = TBL_MASTERDATA.getDataSource().getMembers("PMs");
for (var p=0; pp< pm.length; p++)
{
var pm_str = pm_str + ";" + pm[p].description;
}
/* Getting Directors list from Master Data Model*/
var directors = TBL_MASTERDATA.getDataSource().getMembers("Directors");
for (var d=0; d< directors.length; d++)
{ var directors_str = directors_str + ";" + directors[d].description;}
//To get the user logged in currently
var curr_user = Application.getUserInfo().displayName;
//The below code is to change the User info display name to the format in the master model and compare
var curr_user_parsed = curr_user.slice(curr_user.indexOf(" ")+1,curr_user.length)+", "+curr_user.slice(0,curr_user.indexOf(" "));
var pm_flag = pm_str.indexOf(curr_user_parsed);
var directors_flag = directors_str.indexOf(curr_user_parsed);
if(directors_flag===-1) //if the session user is not a director
{
INPFLD_STATUS.setEnabled(false);
INPFLD_ STATUS.setVisible(true);
DD1_STATUS.setVisible(false);
}
else
{
INPFLD_STATUS.setEnabled(false);
INPFLD_STATUS.setVisible(false);
DD1_ STATUS.setVisible(true);
}
Please feel free to comment your thoughts on this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
10 | |
9 | |
7 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 |