KevinMc KevinMc - 1 year ago 78
AngularJS Question

No Permission error using Firebase

I am trying to add Firebase for the first time to an ionic application. I have set up my project and referenced the javascript files however when I run the application I see the error 'Error: Permission Denied'

I have not yet set up authentication in my app but, if I am understanding things properly I shouldn't need to do this while I am just testing.

My index.html contains the following:

<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- Firebase -->
<script src=""></script>
<!-- AngularFire -->
<script src=""></script>

While the app.js has the following lines:

angular.module('starter', ['ionic', 'firebase'])
.factory("Items", function($firebaseArray) {
var itemsRef = new Firebase("");
return $firebaseArray(itemsRef);

.controller('ListCtrl', function($scope, $ionicListDelegate, Items) {
$scope.items = Items;

$scope.addItem = function () {
var name = prompt("what do you need to buy?");
if (name) {
$scope.items.$add({"name": name});

I would be grateful for any pointers on how to get the basics right as I have tried following the information on the Firebase site and I seem to have it all set up correctly. Am I misunderstanding the authentication or shouldI be able to write to the database without setting this up first ?

Answer Source

It sounds that your Security & Rules isn't giving you access to items. Please make sure to spend some time reading the S&R documentation.

If you are only testing the application and don't want to care about it now just set it to full read and write.

On the new console go to Database > Rules.

  "rules": {
    ".read": true,
    ".write": true