Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
hi community,
how can I Control visibility (hide /show) a button in a mashup depending on a members of a userGroup ?
userGroup Admin : show a button
userGroup Operators : hide this button
thank you in advance
Anass
Solved! Go to Solution.
Create a service where you can call
var result = Resources["CurrentSessionInfo"].GetCurrentUserGroups();
It returns an infotable :
Code for your service ( it returns a boolean ). the "userAdmin" string may be passed as a parameter,
var resultGrp = Resources["CurrentSessionInfo"].GetCurrentUserGroups();
var tableLength = resultGrp.rows.length;
var result = false;
for (var x=0; x < tableLength; x++) {
var row = resultGrp.rows[x];
if("userAdmin" == row.name){
result=true;
break;
}
}
Next, some bindings :
And it works
Create a service where you can call
var result = Resources["CurrentSessionInfo"].GetCurrentUserGroups();
It returns an infotable :
Code for your service ( it returns a boolean ). the "userAdmin" string may be passed as a parameter,
var resultGrp = Resources["CurrentSessionInfo"].GetCurrentUserGroups();
var tableLength = resultGrp.rows.length;
var result = false;
for (var x=0; x < tableLength; x++) {
var row = resultGrp.rows[x];
if("userAdmin" == row.name){
result=true;
break;
}
}
Next, some bindings :
And it works
Hi @olivierfresse,
Thank you for your detailed response, now its clear for me. I accept it as a solution .
Anass