Commits

Endy Muhardin committed 72c9ee1

implement add permission ke role

Comments (0)

Files changed (1)

belajar-restful-web/src/main/webapp/js/aplikasi-controller.js

         
         $scope.saveSelectedPermission = function(){
             console.log($scope.selectedPermission);
+            for ( var i = 0; i < $scope.selectedPermission.length; i++) {
+                var p = {id: $scope.selectedPermission[i]};
+                $scope.currentRole.permissionSet.push(p);
+            }
+            RoleService.save($scope.currentRole)
+            .success(function(){
+                $scope.currentRole = RoleService.get({
+                    id: $scope.currentRole.id
+                });;
+            });
             $scope.showPermissionDialog = false;
         }