Object[] params = new Object[] {
Rfc4314Rights.a_Administer_RIGHT.toString(),
command.getName(),
mailboxName
};
HumanReadableText text = new HumanReadableText(HumanReadableText.UNSUFFICIENT_RIGHTS_KEY, HumanReadableText.UNSUFFICIENT_RIGHTS_DEFAULT_VALUE, params);
no(command, tag, responder, text);
}
else {
MailboxACLEntryKey key = new SimpleMailboxACLEntryKey(identifier);
// FIXME check if identifier is a valid user or group
// FIXME Servers, when processing a command that has an identifier as a
// parameter (i.e., any of SETACL, DELETEACL, and LISTRIGHTS commands),
// SHOULD first prepare the received identifier using "SASLprep" profile
// [SASLprep] of the "stringprep" algorithm [Stringprep]. If the
// preparation of the identifier fails or results in an empty string,
// the server MUST refuse to perform the command with a BAD response.
// Note that Section 6 recommends additional identifier’s verification
// steps.
messageManager.setRights(key, editMode, mailboxAclRights);
okComplete(command, tag, responder);
// FIXME should we send unsolicited responses here?
// unsolicitedResponses(session, responder, false);
}
} catch (UnsupportedRightException e) {
/*
* RFc 4314, section 3.1
* Note that an unrecognized right MUST cause the command to return the
* BAD response. In particular, the server MUST NOT silently ignore
* unrecognized rights.
* */
Object[] params = new Object[] {e.getUnsupportedRight()};
HumanReadableText text = new HumanReadableText(HumanReadableText.UNSUPPORTED_RIGHT_KEY, HumanReadableText.UNSUPPORTED_RIGHT_DEFAULT_VALUE, params);
taggedBad(command, tag, responder, text);
} catch (MailboxNotFoundException e) {
no(command, tag, responder, HumanReadableText.MAILBOX_NOT_FOUND);
} catch (MailboxException e) {
Logger log = session.getLog();