mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-10-29 04:33:25 +00:00
[Web][Dovecot][SOGo][DockerApi] Add mailbox groups, shared mailboxes and identity provider sync
This commit is contained in:
82 files changed
+6488
-1027
No files matched your search
@@ -38,6 +38,12 @@ class ApiResponse
|
||||
return $this->danger($error->msg(), $log);
|
||||
}
|
||||
|
||||
/** Something went partly wrong, but the call itself succeeded */
|
||||
public function warning(string|array $msg, array $log): void
|
||||
{
|
||||
$this->add('warning', $msg, $log);
|
||||
}
|
||||
|
||||
/** Messages collected since the last flush() */
|
||||
public function messages(): array
|
||||
{
|
||||
|
||||
@@ -70,6 +70,24 @@ class Context
|
||||
return $this->apiAccess === 'ro';
|
||||
}
|
||||
|
||||
/** An admin, or a legacy call that may ignore ownership (access_all_exception) */
|
||||
public function hasAdminRights(): bool
|
||||
{
|
||||
return $this->isAdmin() || $this->accessAll;
|
||||
}
|
||||
|
||||
/**
|
||||
* Admin rights; a write also needs more than a read-only API key.
|
||||
*
|
||||
* @throws AccessDenied
|
||||
*/
|
||||
public function requireAdmin(bool $write = true): void
|
||||
{
|
||||
if (!$this->hasAdminRights() || ($write && $this->isReadOnlyApi())) {
|
||||
throw new AccessDenied();
|
||||
}
|
||||
}
|
||||
|
||||
public function hasAcl(string $name): bool
|
||||
{
|
||||
return isset($this->acl[$name]) && $this->acl[$name] == '1';
|
||||
|
||||
Reference in new issue
Block a user