AngularClient: Fix operator.pasPerms() after a reload

This commit is contained in:
Oskar Hahn 2015-11-19 21:49:51 +01:00
parent 07bd763a63
commit b1e7259ce5
2 changed files with 2 additions and 4 deletions

View File

@ -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) {

View File

@ -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();
}
])