Good afternoon guys! I am developing an app and I need it in the html file, have a list of the users of the firebase database and then need to create a conditional to manage the permissions when the user is in some category ... in my code, I have:
this.ref.on('value', resp => {
this.rooms = [];
this.rooms = snapshotToArray(resp);
});
And the snapshot looks like this:
export const snapshotToArray = snapshot => {
let returnArr = [];
snapshot.forEach(childSnapshot => {
let item = childSnapshot.val();
returnArr.push(item);
});
return returnArr;
};
The firebase has the following path: users / teachers and users / responsibles how would the conditional to verify that the current user is in teachers or responsible?