From b1e7259ce5bec376e427bcae972a525b5df5c8c7 Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Thu, 19 Nov 2015 21:49:51 +0100 Subject: [PATCH] AngularClient: Fix operator.pasPerms() after a reload --- openslides/users/static/js/users/base.js | 4 ---- openslides/users/static/js/users/site.js | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/openslides/users/static/js/users/base.js b/openslides/users/static/js/users/base.js index c683f38fc..7f39fbb9e 100644 --- a/openslides/users/static/js/users/base.js +++ b/openslides/users/static/js/users/base.js @@ -59,10 +59,6 @@ angular.module('OpenSlidesApp.users', []) // Add registered group allGroups.push(2); _.forEach(allGroups, function(groupId) { - // Get group from server - Group.find(groupId); - // But do not work with the returned promise, because in - // this case this method can not be called in $watch var group = Group.get(groupId); if (group) { _.forEach(group.permissions, function(perm) { diff --git a/openslides/users/static/js/users/site.js b/openslides/users/static/js/users/site.js index c0839e078..7e752ebea 100644 --- a/openslides/users/static/js/users/site.js +++ b/openslides/users/static/js/users/site.js @@ -178,6 +178,8 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users']) operator.setUser(data.user_id); }); $rootScope.operator = operator; + // Load all Groups. They are needed later + Group.findAll(); } ])