Fix ACL editor for authenticated users in Mailer

This commit is contained in:
Francis Lachapelle
2016-02-23 10:20:10 -05:00
parent aae02741f9
commit e328d43403
5 changed files with 25 additions and 12 deletions
@@ -44,7 +44,7 @@
}
function confirmChange(user) {
var confirmation = user.$confirmRights();
var confirmation = user.$confirmRights(vm.folder);
if (confirmation) {
vm.confirmation.showing = true;
vm.confirmation.message = confirmation;
@@ -195,7 +195,7 @@
* @desc Check if a confirmation is required before giving some rights.
* @return the confirmation message or false if no confirmation is required
*/
User.prototype.$confirmRights = function() {
User.prototype.$confirmRights = function(folder) {
var confirmation = false;
if (this.$confirmation) {
@@ -205,10 +205,18 @@
if (_.some(_.values(this.rights))) {
if (this.uid == 'anonymous') {
confirmation = l('Potentially anyone on the Internet will be able to access your folder, even if they do not have an account on this system. Is this information suitable for the public Internet?');
if (folder.constructor.name == 'AddressBook')
confirmation = l('Potentially anyone on the Internet will be able to access your address book "%{0}", even if they do not have an account on this system. Is this information suitable for the public Internet?', folder.name);
else if (folder.constructor.name == 'Calendar')
confirmation = l('Potentially anyone on the Internet will be able to access your calendar "%{0}", even if they do not have an account on this system. Is this information suitable for the public Internet?', folder.name);
}
else if (this.uid == '<default>') {
confirmation = l('Any user with an account on this system will be able to access your folder. Are you certain you trust them all?');
else if (this.uid == 'anyone' || this.uid == '<default>') {
if (folder.constructor.name == 'AddressBook')
confirmation = l('Any user with an account on this system will be able to access your address book "%{0}". Are you certain you trust them all?', folder.name);
else if (folder.constructor.name == 'Calendar')
confirmation = l('Any user with an account on this system will be able to access your calendar "%{0}". Are you certain you trust them all?', folder.name);
else if (folder.constructor.name == 'Mailbox')
confirmation = l('Any user with an account on this system will be able to access your mailbox "%{0}". Are you certain you trust them all?', folder.name);
}
}