Client doesn't have permission to access the desired data in Firebase
<p>I have a page that is calling <code>addCheckin()</code> method which is inside a controller. In the controller, I am trying to create a reference as follows:</p>

<pre><code>var ref = firebase.database().ref("users/" + $scope.whichuser + "/meetings/" +$scope.whichmeeting + "/checkins");
</code></pre>

<p><code>$scope.whichuser</code> and <code>$scope.whichmeeting</code> are the <code>$routeParams</code> that I am passing from another route.
Here's my checkin controller-</p>

<pre><code>myApp.controller("CheckinsController",
    ['$scope','$rootScope','$firebaseArray','$routeParams','$firebaseObject',
    function($scope,$rootScope,$firebaseArray,$routeParams,$firebaseObject){

        $scope.whichuser = $routeParams.uid;
        $scope.whichmeeting = $routeParams.mid;

        var ref = firebase.database().ref("users/" + $scope.whichuser + "/meetings/" +$scope.whichmeeting + "/checkins");

        $scope.addCheckin = function(){
            var checkinInfo = $firebaseArray(ref);
            var data={
                firstname:$scope.firstname,
                lastname:$scope.lastname,
                email:$scope.email,
                date:firebase.database.ServerValue.TIMESTAMP
            }

            checkinInfo.$add(data);
        }

}]);/*controller*/
</code></pre>

<p>There are two errors that I am getting here-</p>

<p>Error 1:</p>

<p><code>Error: permission_denied at /users/Vp2P1MqKm7ckXqV2Uy3OzTnn6bB3/meetings: Client doesn't have permission to access the desired data.</code></p>

<p>Error 2:</p>

<p><code>Error: permission_denied at /users/Vp2P1MqKm7ckXqV2Uy3OzTnn6bB3/meetings/-KT5tqMYKXsFssmcRLm6/checkins: Client doesn't have permission to access the desired data.</code></p>

<p>And this is what I am tring to achieve-</p>

<p><a href="https://i.stack.imgur.com/WKNiI.png" rel="noreferrer"><img src="https://i.stack.imgur.com/WKNiI.png" alt="enter image description here"></a></p>