automatically assign admin:true when contributor level/tier is greater than 7, and assign admin:false when less than 8

This commit is contained in:
Alice Harris 2014-08-15 21:27:43 +10:00
parent d6ce6f8986
commit eefdfe9234

View file

@ -8,6 +8,7 @@ habitrpg.controller("HallHeroesCtrl", ['$scope', '$rootScope', 'User', 'Notifica
$scope.hero = Hero.get({uid:uuid});
}
$scope.saveHero = function(hero) {
$scope.hero.contributor.admin = ($scope.hero.contributor.level > 7) ? true : false;
hero.$save(function(){
Notification.text("User updated");
$scope.hero = undefined;