This commit is contained in:
Mo Bitar
2018-11-27 12:25:11 -06:00
parent e54d4269c1
commit 0c41815601
3 changed files with 13 additions and 4 deletions

View File

@@ -14,17 +14,20 @@ class PrivilegesManagementModal {
}
}
controller($scope, privilegesManager, passcodeManager, $timeout) {
controller($scope, privilegesManager, passcodeManager, authManager, $timeout) {
'ngInject';
$scope.dummy = {};
$scope.hasPasscode = passcodeManager.hasPasscode();
$scope.hasAccount = !authManager.offline();
$scope.displayInfoForCredential = function(credential) {
let info = privilegesManager.displayInfoForCredential(credential);
if(credential == PrivilegesManager.CredentialLocalPasscode) {
info["availability"] = $scope.hasPasscode;
} else if(credential == PrivilegesManager.CredentialAccountPassword) {
info["availability"] = $scope.hasAccount;
} else {
info["availability"] = true;
}
@@ -69,7 +72,6 @@ class PrivilegesManagementModal {
}
$scope.checkboxValueChanged = function(action, credential) {
console.log("toggleCredentialForAction", action, credential);
$scope.privileges.toggleCredentialForAction(action, credential);
privilegesManager.savePrivileges();
}

View File

@@ -30,9 +30,9 @@ class PrivilegesManager {
PrivilegesManager.SessionLengthOneWeek = 604800;
this.availableActions = [
PrivilegesManager.ActionManagePrivileges,
PrivilegesManager.ActionManageExtensions,
PrivilegesManager.ActionManageBackups,
PrivilegesManager.ActionManagePrivileges,
PrivilegesManager.ActionManagePasscode,
PrivilegesManager.ActionViewLockedNotes,
PrivilegesManager.ActionDeleteNote
@@ -61,6 +61,10 @@ class PrivilegesManager {
}
presentPrivilegesModal(action, onSuccess, onCancel) {
if(this.authenticationInProgress()) {
onCancel && onCancel();
return;
}
let customSuccess = () => {
onSuccess && onSuccess();

View File

@@ -87,7 +87,7 @@
%a.panel-row.condensed{"ng-click" => "openPasswordWizard('change-pw')"}
Change Password
%a.panel-row.condensed{"ng-click" => "openPrivilegesModal('')"}
%a.panel-row.condensed{"ng-show" => "user", "ng-click" => "openPrivilegesModal('')"}
Manage Privileges
%a.panel-row.justify-left.condensed.success{"ng-if" => "securityUpdateAvailable", "ng-click" => "openPasswordWizard('upgrade-security')"}
.inline.circle.small.success.mr-8
@@ -114,6 +114,7 @@
%p Adding a passcode is not supported in temporary sessions. Please sign out, then sign back in with the "Stay signed in" option checked.
%form{"ng-if" => "formData.showPasscodeForm", "ng-submit" => "submitPasscodeForm()"}
.panel-row
%input.form-control{:type => 'password', "ng-model" => "formData.passcode", "placeholder" => "Passcode", "sn-autofocus" => "true", "should-focus" => "true"}
%input.form-control{:type => 'password', "ng-model" => "formData.confirmPasscode", "placeholder" => "Confirm Passcode"}
.button-group.stretch.panel-row.form-submit
@@ -138,6 +139,8 @@
{{option.label}}
%p The autolock timer begins when the window or tab loses focus.
%a.panel-row.condensed{"ng-show" => "!user", "ng-click" => "openPrivilegesModal('')"}
Manage Privileges
.panel-section{"ng-if" => "!importData.loading"}
%h3.title Data Backups