diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index 11c404c6d..f7fc8f759 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -1326,6 +1326,8 @@ static NSComparisonResult _compareFetchResultsByUID (id entry1, id entry2, NSArr switch ([imapAcls characterAtIndex: count]) { case 'l': + [SOGoAcls addObjectUniquely: SOGoRole_FolderViewer]; + break; case 'r': [SOGoAcls addObjectUniquely: SOGoRole_ObjectViewer]; break; @@ -1408,11 +1410,10 @@ static NSComparisonResult _compareFetchResultsByUID (id entry1, id entry2, NSArr acls = [sogoAcls objectEnumerator]; while ((currentAcl = [acls nextObject])) { - if ([currentAcl isEqualToString: SOGoRole_ObjectViewer]) - { - [imapAcls appendFormat: @"lr"]; - character = 0; - } + if ([currentAcl isEqualToString: SOGoRole_FolderViewer]) + character = 'l'; + else if ([currentAcl isEqualToString: SOGoRole_ObjectViewer]) + character = 'r'; else if ([currentAcl isEqualToString: SOGoMailRole_SeenKeeper]) character = 's'; else if ([currentAcl isEqualToString: SOGoMailRole_Writer]) diff --git a/SoObjects/SOGo/SOGoPermissions.h b/SoObjects/SOGo/SOGoPermissions.h index 79d4b2fdb..b601bd23d 100644 --- a/SoObjects/SOGo/SOGoPermissions.h +++ b/SoObjects/SOGo/SOGoPermissions.h @@ -1,8 +1,6 @@ /* SOGoPermissions.h - this file is part of SOGo * - * Copyright (C) 2006 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2006-2021 Inverse inc. * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/SoObjects/SOGo/SOGoPermissions.m b/SoObjects/SOGo/SOGoPermissions.m index 7f9cb56ce..122c1f0b6 100644 --- a/SoObjects/SOGo/SOGoPermissions.m +++ b/SoObjects/SOGo/SOGoPermissions.m @@ -1,6 +1,6 @@ /* SOGoPermissions.m - this file is part of SOGo * - * Copyright (C) 2006-2014 Inverse inc. + * Copyright (C) 2006-2021 Inverse inc. * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,6 +28,7 @@ NSString *SOGoRole_ObjectEditor = @"ObjectEditor"; NSString *SOGoRole_FolderCreator = @"FolderCreator"; NSString *SOGoRole_FolderEraser = @"FolderEraser"; +NSString *SOGoRole_FolderViewer = @"FolderViewer"; NSString *SOGoRole_AuthorizedSubscriber = @"AuthorizedSubscriber"; NSString *SOGoRole_PublicUser = @"PublicUser"; diff --git a/UI/MailerUI/English.lproj/Localizable.strings b/UI/MailerUI/English.lproj/Localizable.strings index 3c6982ad4..15ea7e9be 100644 --- a/UI/MailerUI/English.lproj/Localizable.strings +++ b/UI/MailerUI/English.lproj/Localizable.strings @@ -82,7 +82,7 @@ "Access rights to" = "Access rights to"; "For user" = "For user"; "Any Authenticated User" = "Any Authenticated User"; -"List and see this folder" = "List and see this folder"; +"View this folder" = "View this folder"; "Read mails from this folder" = "Read mails from this folder"; "Mark mails read and unread" = "Mark mails read and unread"; "Modify the flags of the mails in this folder" = "Modify the flags of the mails in this folder"; diff --git a/UI/MailerUI/UIxMailUserRightsEditor.m b/UI/MailerUI/UIxMailUserRightsEditor.m index 6e3456aad..54a2ec758 100644 --- a/UI/MailerUI/UIxMailUserRightsEditor.m +++ b/UI/MailerUI/UIxMailUserRightsEditor.m @@ -36,6 +36,11 @@ return ([account imapAclStyle] == rfc4314); } +- (BOOL) userCanViewFolder +{ + return [userRights containsObject: SOGoRole_FolderViewer]; +} + - (void) setUserCanReadMails: (BOOL) userCanReadMails { if (userCanReadMails) @@ -169,6 +174,7 @@ - (NSDictionary *) userRightsForObject { return [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithBool:[self userCanViewFolder]], @"userCanViewFolder", [NSNumber numberWithBool:[self userCanReadMails]], @"userCanReadMails", [NSNumber numberWithBool:[self userCanMarkMailsRead]], @"userCanMarkMailsRead", [NSNumber numberWithBool:[self userCanWriteMails]], @"userCanWriteMails", @@ -184,6 +190,11 @@ - (void) updateRights: (NSDictionary *) newRights { + if ([[newRights objectForKey: @"userCanViewFolder"] boolValue]) + [self appendRight: SOGoRole_FolderViewer]; + else + [self removeRight: SOGoRole_FolderViewer]; + if ([[newRights objectForKey: @"userCanReadMails"] boolValue]) [self appendRight: SOGoRole_ObjectViewer]; else diff --git a/UI/Templates/MailerUI/UIxMailUserRightsEditor.wox b/UI/Templates/MailerUI/UIxMailUserRightsEditor.wox index 3390dcebd..b668c1214 100644 --- a/UI/Templates/MailerUI/UIxMailUserRightsEditor.wox +++ b/UI/Templates/MailerUI/UIxMailUserRightsEditor.wox @@ -9,6 +9,14 @@
+ + + +