mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Activate RFC 4314 MYRIGHTS
This commit is contained in:
parent
4c0b0b102a
commit
4f5db79e27
2 changed files with 19 additions and 18 deletions
|
|
@ -575,6 +575,12 @@ trait Folders
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->hasCapability('ACL') || $this->CapabilityValue('RIGHTS')) {
|
||||||
|
foreach ($oFolderCollection as $oFolder) {
|
||||||
|
$oFolder->myRights = $this->FolderMyRights($oFolder->FullName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!$bInbox && !$sParentFolderName && !isset($oFolderCollection['INBOX'])) {
|
if (!$bInbox && !$sParentFolderName && !isset($oFolderCollection['INBOX'])) {
|
||||||
$oFolderCollection['INBOX'] = new Folder('INBOX', $sDelimiter);
|
$oFolderCollection['INBOX'] = new Folder('INBOX', $sDelimiter);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@ class Folder implements \JsonSerializable
|
||||||
*/
|
*/
|
||||||
private array $aMetadata = array();
|
private array $aMetadata = array();
|
||||||
|
|
||||||
|
public ?Responses\ACL $myRights = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
|
|
@ -146,12 +148,6 @@ class Folder implements \JsonSerializable
|
||||||
#[\ReturnTypeWillChange]
|
#[\ReturnTypeWillChange]
|
||||||
public function jsonSerialize()
|
public function jsonSerialize()
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
if ($this->ImapClient->hasCapability('ACL') || $this->ImapClient->CapabilityValue('RIGHTS')) {
|
|
||||||
// MailSo\Imap\Responses\ACL
|
|
||||||
$rights = $this->ImapClient->FolderMyRights($this->FullName);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
$result = array(
|
$result = array(
|
||||||
'@Object' => 'Object/Folder',
|
'@Object' => 'Object/Folder',
|
||||||
'name' => $this->Name(),
|
'name' => $this->Name(),
|
||||||
|
|
@ -165,20 +161,19 @@ class Folder implements \JsonSerializable
|
||||||
'unreadEmails' => $this->UNSEEN,
|
'unreadEmails' => $this->UNSEEN,
|
||||||
'id' => $this->MAILBOXID,
|
'id' => $this->MAILBOXID,
|
||||||
'size' => $this->SIZE,
|
'size' => $this->SIZE,
|
||||||
'role' => $this->Role()
|
'role' => $this->Role(),
|
||||||
/*
|
|
||||||
'myRights' => [
|
'myRights' => [
|
||||||
'mayReadItems' => !$rights || ($rights->hasRight('l') && $rights->hasRight('r')),
|
'mayReadItems' => !$this->myRights || ($this->myRights->hasRight('l') && $this->myRights->hasRight('r')),
|
||||||
'mayAddItems' => !$rights || $rights->hasRight('i'),
|
'mayAddItems' => !$this->myRights || $this->myRights->hasRight('i'),
|
||||||
'mayRemoveItems' => !$rights || ($rights->hasRight('t') && $rights->hasRight('e')),
|
'mayRemoveItems' => !$this->myRights || ($this->myRights->hasRight('t') && $this->myRights->hasRight('e')),
|
||||||
'maySetSeen' => !$rights || $rights->hasRight('s'),
|
'maySetSeen' => !$this->myRights || $this->myRights->hasRight('s'),
|
||||||
'maySetKeywords' => !$rights || $rights->hasRight('w'),
|
'maySetKeywords' => !$this->myRights || $this->myRights->hasRight('w'),
|
||||||
'mayCreateChild' => !$rights || $rights->hasRight('k'),
|
'mayCreateChild' => !$this->myRights || $this->myRights->hasRight('k'),
|
||||||
'mayRename' => !$rights || $rights->hasRight('x'),
|
'mayRename' => !$this->myRights || $this->myRights->hasRight('x'),
|
||||||
'mayDelete' => !$rights || $rights->hasRight('x'),
|
'mayDelete' => !$this->myRights || $this->myRights->hasRight('x'),
|
||||||
'maySubmit' => !$rights || $rights->hasRight('p')
|
'maySubmit' => !$this->myRights || $this->myRights->hasRight('p')
|
||||||
]
|
]
|
||||||
*/
|
|
||||||
);
|
);
|
||||||
if ($this->etag) {
|
if ($this->etag) {
|
||||||
$result['etag'] = $this->etag;
|
$result['etag'] = $this->etag;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue