acl-mailbox.c revision 103106f0227b8487abc1e2c6ad63b84cdc51388e
/* Copyright (c) 2006-2008 Dovecot authors, see the included COPYING file */
should still be stored temporarily for this session. However most clients
don't care and it's a huge job, so I currently this isn't done. The same
problem actually exists when opening read-only mailboxes. */
#include "lib.h"
#include "array.h"
#include "istream.h"
#include "mailbox-list-private.h"
#include "acl-api-private.h"
#include "acl-plugin.h"
#define ACL_MAIL_CONTEXT(obj) \
struct acl_mailbox {
union mailbox_module_context module_ctx;
struct acl_object *aclobj;
unsigned int save_hack:1;
};
struct acl_transaction_context {
};
static struct acl_transaction_context acl_transaction_failure;
{
int ret;
if (ret > 0)
return 1;
if (ret < 0) {
return -1;
}
return 0;
}
{
return TRUE;
return FALSE;
return FALSE;
/* Next up is the "shared flag rights" */
return FALSE;
return FALSE;
return FALSE;
return TRUE;
}
{
return FALSE;
}
{
}
static int
{
int ret;
if (ret < 0)
return -1;
if (ret < 0)
return -1;
*flag_seen_r = ret > 0;
if (ret < 0)
return -1;
*flag_del_r = ret > 0;
return 0;
}
static void acl_transaction_set_failure(struct mailbox_transaction_context *t)
{
}
static void
enum mail_flags flags)
{
&acl_flag_del) < 0) {
return;
}
if (modify_type != MODIFY_REPLACE) {
flags from the mask. */
if (!acl_flags)
if (!acl_flag_seen)
if (!acl_flag_del)
flags &= ~MAIL_DELETED;
/* we don't have permission to replace all the flags. */
/* no flag changes allowed. ignore silently. */
return;
}
/* handle this by first removing the allowed flags and
then adding the allowed flags */
if (flags != 0)
return;
}
}
static void
struct mail_keywords *keywords)
{
int ret;
if (ret <= 0) {
/* if we don't have permission, just silently return success. */
if (ret < 0)
return;
}
}
{
int ret;
if (ret <= 0) {
/* if we don't have permission, silently return success so
users won't see annoying error messages in case their
clients try automatic expunging. */
if (ret < 0)
return;
}
}
static struct mail *
acl_mail_alloc(struct mailbox_transaction_context *t,
struct mailbox_header_lookup_ctx *wanted_headers)
{
union mail_module_context *amail;
struct mail_private *mail;
return _mail;
}
struct mail_keywords **keywords)
{
&acl_flag_del) < 0)
return -1;
if (!acl_flag_seen)
if (!acl_flag_del)
*flags &= ~MAIL_DELETED;
if (!acl_flags) {
}
return 0;
}
static int
acl_save_init(struct mailbox_transaction_context *t,
{
return -1;
return -1;
}
static int
{
return -1;
return -1;
}
static int
{
return -1;
}
}
static int
{
int ret;
if (ret < 0) {
if (!skip_invalid)
return -1;
/* we can't return failure. assume we don't have permissions. */
ret = 0;
}
if (ret == 0) {
/* no permission to update any flags. just return empty
keywords list. */
}
}
{
struct acl_mailbox *abox;
return box;
}