diff --git a/js/app/controllers/share.js b/js/app/controllers/share.js index 8c5d093c..e4209108 100644 --- a/js/app/controllers/share.js +++ b/js/app/controllers/share.js @@ -68,16 +68,16 @@ angular.module('passmanApp') $scope.accessLevels = [ { label: 'Can edit', - value: 'CAN_EDIT' + value: '2' }, { label: 'Can view', - value: 'CAN_VIEW' + value: '1' } ]; $scope.inputSharedWith = []; - $scope.selectedAccessLevel = 'CAN_VIEW'; + $scope.selectedAccessLevel = '1'; $scope.searchUsers = function($query){ return ShareService.search($query) @@ -99,5 +99,14 @@ angular.module('passmanApp') } } - + $scope.applyShare = function(){ + console.log("boom!"); + var list = $scope.share_settings.credentialSharedWithUserAndGroup; + console.log(list); + for (var i = 0; i < list.length; i++){ + ShareService.getVaultsByUser(list[i].user_id).then(function(data){ + console.log(data); + }) + } + } }]); diff --git a/js/app/controllers/vault.js b/js/app/controllers/vault.js index 3ba69963..1fc7626a 100644 --- a/js/app/controllers/vault.js +++ b/js/app/controllers/vault.js @@ -74,11 +74,11 @@ angular.module('passmanApp') }; var key_size = 1024; - ShareService.generateRSAKeys(key_size, function (progress) { + ShareService.generateRSAKeys(key_size).progress(function (progress) { var p = progress > 0 ? 2 : 1; $scope.$apply(); $scope.creating_keys = 'Generating sharing keys (' + p + ' / 2)'; - }, function (kp) { + }).then(function (kp) { var pem = ShareService.rsaKeyPairToPEM(kp); $scope.creating_keys = false; $scope.sharing_keys.private_sharing_key = pem.privateKey; diff --git a/js/templates.js b/js/templates.js index da4c3ad1..749df644 100644 --- a/js/templates.js +++ b/js/templates.js @@ -101,7 +101,7 @@ angular.module('views/settings.html', []).run(['$templateCache', function($templ angular.module('views/share_credential.html', []).run(['$templateCache', function($templateCache) { 'use strict'; $templateCache.put('views/share_credential.html', - '