From 0d37b69d3b82bdb6f1c84a882913ec8635f800a6 Mon Sep 17 00:00:00 2001 From: brantje Date: Mon, 3 Oct 2016 18:44:49 +0200 Subject: [PATCH] Push baby, added setPermission --- js/app/controllers/share.js | 8 ++++++++ js/templates.js | 2 +- .../views/partials/forms/share_credential/basics.html | 9 ++++----- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/js/app/controllers/share.js b/js/app/controllers/share.js index daa8c441..402fb697 100644 --- a/js/app/controllers/share.js +++ b/js/app/controllers/share.js @@ -109,6 +109,14 @@ angular.module('passmanApp') return acl.hasPermission(permission); }; + $scope.setPermission = function(acl, permission){ + if(acl.hasPermission(permission)){ + acl.removePermission(permission); + } else { + acl.addPermission(permission); + } + }; + $scope.shareWith = function (shareWith, selectedAccessLevel) { //@TODO Improve this so we can add, edit and remove users and permissions. $scope.inputSharedWith = []; diff --git a/js/templates.js b/js/templates.js index bece3fae..6cdb5e34 100644 --- a/js/templates.js +++ b/js/templates.js @@ -81,7 +81,7 @@ angular.module('views/partials/forms/settings/tool.html', []).run(['$templateCac angular.module('views/partials/forms/share_credential/basics.html', []).run(['$templateCache', function($templateCache) { 'use strict'; $templateCache.put('views/partials/forms/share_credential/basics.html', - '
Cyphering...
UserCrypto time
{{user.user}}{{user.time}} s
Total time spent cyphering: {{ calculate_total_time() }}
UserReadWriteFilesRevisions
{{user.userId}} {{user}}
'); }]); diff --git a/templates/views/partials/forms/share_credential/basics.html b/templates/views/partials/forms/share_credential/basics.html index 9fc1b401..9770140b 100644 --- a/templates/views/partials/forms/share_credential/basics.html +++ b/templates/views/partials/forms/share_credential/basics.html @@ -68,12 +68,11 @@ {{user.userId}} - {{user}} - - - - + + + +