Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. 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