Skip to content

Commit

Permalink
fix(admininistration(js)): improve handling of unauthorized access
Browse files Browse the repository at this point in the history
  • Loading branch information
cgx committed May 16, 2022
1 parent dd07309 commit 1328a25
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
},
resolve: {
stateUser: stateUser,
stateFolder: stateFolder
stateFolder: stateFolder,
stateAcls: stateAcls
}
})
.state('administration.theme', {
Expand Down Expand Up @@ -120,6 +121,11 @@
return o;
}

stateAcls.$inject = ['stateFolder'];
function stateAcls(stateFolder) {
return stateFolder.$acl.$users(stateFolder.owner);
}

/**
* @ngInject
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
/**
* @ngInject
*/
AdministrationAclController.$inject = ['$timeout', '$state', '$mdMedia', '$mdToast', 'stateUser', 'stateFolder', 'sgConstant', 'User'];
function AdministrationAclController($timeout, $state, $mdMedia, $mdToast, stateUser, stateFolder, sgConstant, User) {
AdministrationAclController.$inject = ['$timeout', '$state', '$mdMedia', '$mdToast', 'stateUser', 'stateFolder', 'stateAcls', 'sgConstant', 'User'];
function AdministrationAclController($timeout, $state, $mdMedia, $mdToast, stateUser, stateFolder, stateAcls, sgConstant, User) {
var vm = this;

vm.user = stateUser;
vm.folder = stateFolder;
vm.users = stateAcls;
vm.folderType = angular.isDefined(stateFolder.$cards)? 'AddressBook' : 'Calendar';
vm.selectedUser = null;
vm.selectedUid = null;
Expand All @@ -29,9 +30,6 @@
vm.userFilter = userFilter;
vm.addUser = addUser;

stateFolder.$acl.$users(stateFolder.owner).then(function(data) {
vm.users = data;
});

function getTemplate() {
if (angular.isDefined(stateFolder.$cards))
Expand Down

0 comments on commit 1328a25

Please sign in to comment.