Ensure notifications are only fetched and shown for at least admins

This commit is contained in:
Johannes Zellner
2021-07-07 19:07:43 +02:00
parent 2cb698c6bd
commit 9bbd1af259
3 changed files with 6 additions and 2 deletions

View File

@@ -64,6 +64,8 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
};
function refreshNotifications() {
if (!Client.getUserInfo().isAtLeastAdmin) return;
Client.getNotifications({ acknowledged: false }, 1, 100, function (error, results) { // counter maxes out at 100
if (error) console.error(error);
else $scope.notificationCount = results.length;