Merge pull request #1689 from ostcar/fix_pas_perms_after_reload

AngularClient: Fix operator.pasPerms() after a reload
This commit is contained in:
Oskar Hahn 2015-11-19 22:34:03 +01:00
commit 2458cc97fb
2 changed files with 2 additions and 4 deletions

View File

@ -59,10 +59,6 @@ angular.module('OpenSlidesApp.users', [])
// Add registered group // Add registered group
allGroups.push(2); allGroups.push(2);
_.forEach(allGroups, function(groupId) { _.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); var group = Group.get(groupId);
if (group) { if (group) {
_.forEach(group.permissions, function(perm) { _.forEach(group.permissions, function(perm) {

View File

@ -178,6 +178,8 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
operator.setUser(data.user_id); operator.setUser(data.user_id);
}); });
$rootScope.operator = operator; $rootScope.operator = operator;
// Load all Groups. They are needed later
Group.findAll();
} }
]) ])