(js) Improve ACLs handling of inactive users

This commit is contained in:
Francis Lachapelle
2017-01-26 12:48:21 -05:00
parent 831c1bc980
commit d14b0b0b5e
6 changed files with 35 additions and 7 deletions
@@ -18,6 +18,7 @@
vm.selectedUid = null;
vm.selectUser = selectUser;
vm.selectAllRights = selectAllRights;
vm.showRights = showRights;
vm.removeUser = removeUser;
vm.getTemplate = getTemplate;
vm.close = close;
@@ -56,6 +57,10 @@
}
}
function showRights(user) {
return vm.selectedUid == user.uid && user.rights;
}
function userFilter($query) {
return User.$filter($query, stateFolder.$acl.users, { dry: true, uid: vm.user.uid });
}
@@ -24,6 +24,7 @@
vm.addUser = addUser;
vm.selectAllRights = selectAllRights;
vm.selectUser = selectUser;
vm.showRights = showRights;
vm.confirmation = { showing: false,
message: ''};
@@ -86,6 +87,10 @@
vm.selectedUser.$rights();
}
}
function showRights(user) {
return vm.selectedUid == user.uid && user.rights;
}
}
angular
@@ -125,13 +125,22 @@
this.empty = ' ';
};
/**
* @function $fullname
* @memberof User.prototype
* @return a string representing the fullname
*/
User.prototype.$fullname = function() {
return this.cn || this.uid;
};
/**
* @function $shortFormat
* @memberof User.prototype
* @return the fullname along with the email address
*/
User.prototype.$shortFormat = function(options) {
var fullname = this.cn || this.c_email;
var fullname = this.$fullname();
var email = this.c_email;
var no_email = options && options.email === false;
if (!no_email && email && fullname != email) {