This is an automated email from the git hooks/post-receive script. New commit to branch feature/permissionPollRestricted in repository pollen. See http://git.chorem.org/pollen.git commit 2e4da276dd2a94e2ed376da42a611b7d51cc88ba Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Wed Aug 6 16:24:27 2014 +0200 redirect if not admin in user list, fix edit vote --- pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js | 7 ------- pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js | 9 +++++++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js index dd0384d..3022d8e 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -1163,12 +1163,6 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr $scope.data.vote.id = returnRequest.id; $scope.data.vote.permission = returnRequest.permission; - angular.forEach($scope.data.vote.choice, function (choice) { - if (choice.voteValue == "") { - delete choice.voteValue; - } - }); - PollVote.get({pollId:$routeParams.pollId, voteId:returnRequest.id, permission:returnRequest.permission}, function (newVote) { angular.forEach(newVote.choice, function (choice) { choice.voteValue = $scope.getVoteValue(choice.voteValue); @@ -1267,7 +1261,6 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr } } - delete $scope.data.vote.restError; $rootScope.$broadcast('newSuccess', 'vote.added'); $location.url('/poll/vote/'+$routeParams.pollId+'/'+ data.permission); }, function (error) { diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js index 1d06329..9e8984b 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js @@ -133,8 +133,8 @@ angular.module('userControllers', []) } }]) -.controller('UserListCtrl', ['$scope', '$rootScope', '$routeParams', 'User', 'UserLostPassword', 'Page', - function ($scope, $rootScope, $routeParams, User, UserLostPassword, Page) { +.controller('UserListCtrl', ['$scope', '$rootScope', '$location', '$routeParams', 'User', 'UserLostPassword', 'Page', + function ($scope, $rootScope, $location, $routeParams, User, UserLostPassword, Page) { Page.setTitle('title.user.list'); @@ -162,6 +162,11 @@ angular.module('userControllers', []) User.get({paginationParameter:paginationParameter}, function (data) { $scope.data.users = data.elements; $scope.data.usersPagination = data.pagination + }, function (error) { + if (error.status == 403) { + $rootScope.$broadcast('newError', 'error.forbidden'); + $location.url('/'); + } }); $scope.saveUser = function (user) { -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.