                 @confirm.notify('error')
 
     setComputable: ->
-        onSuccess = null
+        onSuccess = =>
+            @confirm.notify("success")
 
         onError = =>
             @confirm.notify("error")


                $repo.save($scope.role).then onSuccess, onError


        $scope.$on "$destroy", ->
            $el.off()



            $el.on "change", ".category-item input", (event) ->
                getActivePermissions = ->
                    activePermissions = _.filter($el.find(".category-item input"), (t) ->
                        angular.element(t).is(":checked")
                    )
                    activePermissions = _.sortBy(_.map(activePermissions, (t) ->
                        permission = angular.element(t).parents(".category-item").data("id")
                    ))
                    activePermissions.push("view_project")
                    return activePermissions

                target = angular.element(event.currentTarget)
                $scope.role.permissions = getActivePermissions()

