Lines Matching refs:box
32 if (!t->box->storage->user->dsyncing) {
33 mail_storage_set_error(t->box->storage, MAIL_ERROR_PERM,
38 if (mailbox_attribute_value_to_string(t->box->storage, value,
49 mail_storage_set_error(t->box->storage, MAIL_ERROR_PARAMS, error);
56 static int acl_attribute_get_acl(struct mailbox *box, const char *key,
59 struct acl_object *aclobj = acl_mailbox_get_aclobj(box);
67 if (!box->storage->user->dsyncing) {
68 mail_storage_set_error(box->storage, MAIL_ERROR_PERM,
80 mail_storage_set_error(box->storage, MAIL_ERROR_PARAMS,
95 mail_storage_set_internal_error(box->storage);
99 static int acl_have_attribute_rights(struct mailbox *box)
103 if (box->deleting) {
115 ret = acl_mailbox_right_lookup(box, ACL_STORAGE_RIGHT_LOOKUP);
119 mail_storage_set_error(box->storage, MAIL_ERROR_NOTFOUND,
120 T_MAIL_ERR_MAILBOX_NOT_FOUND(box->vname));
124 if (acl_mailbox_right_lookup(box, ACL_STORAGE_RIGHT_READ) > 0)
126 if (acl_mailbox_right_lookup(box, ACL_STORAGE_RIGHT_WRITE_SEEN) > 0)
128 if (acl_mailbox_right_lookup(box, ACL_STORAGE_RIGHT_WRITE) > 0)
130 if (acl_mailbox_right_lookup(box, ACL_STORAGE_RIGHT_INSERT) > 0)
132 if (acl_mailbox_right_lookup(box, ACL_STORAGE_RIGHT_POST) > 0)
141 struct acl_mailbox *abox = ACL_CONTEXT_REQUIRE(t->box);
143 if (acl_have_attribute_rights(t->box) < 0)
151 int acl_attribute_get(struct mailbox *box,
155 struct acl_mailbox *abox = ACL_CONTEXT_REQUIRE(box);
157 if (acl_have_attribute_rights(box) < 0)
161 return acl_attribute_get_acl(box, key, value_r);
162 return abox->module_ctx.super.attribute_get(box, type, key, value_r);
166 acl_attribute_iter_init(struct mailbox *box, enum mail_attribute_type type,
169 struct acl_mailbox *abox = ACL_CONTEXT_REQUIRE(box);
173 aiter->iter.box = box;
174 if (acl_have_attribute_rights(box) < 0)
178 attribute_iter_init(box, type, prefix);
179 if (box->storage->user->dsyncing &&
207 mail_storage_set_internal_error(aiter->iter.box->storage);
217 struct acl_mailbox *abox = ACL_CONTEXT_REQUIRE(iter->box);
233 struct acl_mailbox *abox = ACL_CONTEXT_REQUIRE(iter->box);
241 mail_storage_set_internal_error(aiter->iter.box->storage);