use of com.zimbra.soap.admin.message.FlushCacheRequest in project zm-mailbox by Zimbra.
the class GrantRight method handle.
@Override
public Element handle(Element request, Map<String, Object> context) throws ServiceException {
ZimbraSoapContext zsc = getZimbraSoapContext(context);
GrantRightRequest grReq = JaxbUtil.elementToJaxb(request);
RightModifierInfo modifierInfo = grReq.getRight();
if (modifierInfo == null) {
throw ServiceException.INVALID_REQUEST("No information specified on what right to assign", null);
}
RightModifier rightModifier = getRightModifier(modifierInfo);
// right checking is done in RightCommand
EffectiveRightsTargetSelector erTargSel = grReq.getTarget();
RightCommand.grantRight(Provisioning.getInstance(), getAuthenticatedAccount(zsc), erTargSel, grReq.getGrantee(), modifierInfo.getValue(), rightModifier);
// Bug 100965 Avoid Cross server delegate admin being broken after initial creation due to stale caches
if (com.zimbra.soap.type.TargetType.domain == erTargSel.getType()) {
TargetBy by = erTargSel.getBy();
if ((TargetBy.id == by) || (TargetBy.name == by)) {
CacheSelector cacheSel = new CacheSelector(true, /* allServers */
CacheEntryType.domain.toString());
CacheEntrySelector ceSel = new CacheEntrySelector((TargetBy.id == erTargSel.getBy()) ? CacheEntryBy.id : CacheEntryBy.name, erTargSel.getValue());
cacheSel.addEntry(ceSel);
FlushCacheRequest fcReq = new FlushCacheRequest(cacheSel);
try {
FlushCache.doFlushCache(this, context, fcReq);
} catch (ServiceException se) {
ZimbraLog.acl.info("Problem flushing acl cache for domain %s/%s after granting rights", erTargSel.getBy(), erTargSel.getValue(), se);
}
}
}
Element response = zsc.createElement(AdminConstants.GRANT_RIGHT_RESPONSE);
return response;
}
use of com.zimbra.soap.admin.message.FlushCacheRequest in project zm-mailbox by Zimbra.
the class FlushCache method handle.
@Override
public Element handle(Element request, Map<String, Object> context) throws ServiceException {
ZimbraSoapContext zsc = getZimbraSoapContext(context);
FlushCacheRequest req = JaxbUtil.elementToJaxb(request);
doFlushCache(this, context, req);
return zsc.jaxbToElement(new FlushCacheResponse());
}
Aggregations