Respect mailbox administration rights of user

This commit is contained in:
Francis Lachapelle
2016-11-23 11:16:13 -05:00
parent eee1cb19d0
commit 1ff24dddfc
2 changed files with 16 additions and 15 deletions

1
NEWS
View File

@@ -16,6 +16,7 @@ Bug fixes
- [core] always send IMIP messages using UTF-8
- [web] fixed support for recurrent tasks
- [web] improved validation of mail account delegators
- [web] allow edition of a mailbox rights when user can administer mailbox
2.3.17 (2016-10-20)
-------------------

View File

@@ -1517,11 +1517,12 @@ _compareFetchResultsByMODSEQ (id entry1, id entry2, void *data)
path = [[self imap4Connection] imap4FolderNameForURL: [self imap4URL]];
if ([self _path: path
isInNamespaces: [mailAccount otherUsersFolderNamespaces]]
|| [self _path: path
isInNamespaces: [mailAccount sharedFolderNamespaces]])
isInNamespaces: [mailAccount otherUsersFolderNamespaces]] ||
[self _path: path
isInNamespaces: [mailAccount sharedFolderNamespaces]])
[acls addObject: SOGoRole_ObjectViewer];
else
// Inside user's namespace, automatically owner
[acls addObject: SoRole_Owner];
return acls;
@@ -1534,23 +1535,22 @@ _compareFetchResultsByMODSEQ (id entry1, id entry2, void *data)
userLogin = [[context activeUser] login];
if ([uid isEqualToString: userLogin])
// Login user wants her ACLs
acls = [self _sharesACLs];
else
// Login user wants the ACLs of another user
acls = [NSMutableArray array];
if ([owner isEqualToString: userLogin])
{
if (!mailboxACL)
[self _readMailboxACL];
if (!mailboxACL)
[self _readMailboxACL];
if ([mailboxACL isKindOfClass: [NSDictionary class]])
{
userAcls = [mailboxACL objectForKey: uid];
if (!([userAcls length] || [uid isEqualToString: defaultUserID]))
userAcls = [mailboxACL objectForKey: defaultUserID];
if ([userAcls length])
[acls addObjectsFromArray: [self _imapAclsToSOGoAcls: userAcls]];
}
if ([mailboxACL isKindOfClass: [NSDictionary class]])
{
userAcls = [mailboxACL objectForKey: uid];
if (!([userAcls length] || [uid isEqualToString: defaultUserID]))
userAcls = [mailboxACL objectForKey: defaultUserID];
if ([userAcls length])
[acls addObjectsFromArray: [self _imapAclsToSOGoAcls: userAcls]];
}
return acls;