1
I own a array
with the working groups that the session user belongs to, for example if I write like this:
return $data.teste02[0].group_id.name
It returns me the first group that this user belongs to, which in this case would be administrator
But there are cases that the session user will belong to more than one group, and I need to know all the working groups that he belongs to, so I thought I’d make a for
to be able to access all the groups, thinking about it I made the following code:
for (var x = 0; x <= $data.teste02.length; x++){
return $data.teste02[x].group_id.name;
}
But even so it only returns me the working group of the first position. If you have any idea how I can achieve that.
Perfect, the idea of adding in another array worked perfectly. As soon as it becomes available I mark your answer as correct.
– R.Santos