提交 5b84ac5b 编写于 作者: S sanluan

管理员可以在前台修改他人投稿

上级 bbdbbcab
......@@ -70,7 +70,8 @@ public class CommentController {
entity.setStatus(CmsCommentService.STATUS_PEND);
if (null != entity.getId()) {
CmsComment oldEntity = service.getEntity(entity.getId());
if (null != oldEntity && !oldEntity.isDisabled() && oldEntity.getUserId() == user.getId()) {
if (null != oldEntity && !oldEntity.isDisabled()
&& (oldEntity.getUserId() == user.getId() || user.isSuperuserAccess())) {
entity.setUpdateDate(CommonUtils.getDate());
entity = service.update(entity.getId(), entity, ignoreProperties);
logOperateService
......
......@@ -111,14 +111,15 @@ public class ContentController {
CmsContentAdminController.initContent(entity, cmsModel, draft, false, attribute, false, CommonUtils.getDate());
if (null != entity.getId()) {
CmsContent oldEntity = service.getEntity(entity.getId());
if (null == oldEntity || ControllerUtils.verifyNotEquals("siteId", site.getId(), oldEntity.getSiteId(), model)) {
return UrlBasedViewResolver.REDIRECT_URL_PREFIX + returnUrl;
}
entity = service.update(entity.getId(), entity, entity.isOnlyUrl() ? CmsContentAdminController.ignoreProperties
: CmsContentAdminController.ignorePropertiesWithUrl);
if (null != entity.getId()) {
logOperateService.save(new LogOperate(site.getId(), user.getId(), LogLoginService.CHANNEL_WEB, "update.content",
RequestUtils.getIpAddress(request), CommonUtils.getDate(), JsonUtils.getString(entity)));
if (null != oldEntity && ControllerUtils.verifyNotEquals("siteId", site.getId(), oldEntity.getSiteId(), model)
&& (oldEntity.getUserId() == user.getId() || user.isSuperuserAccess())) {
entity = service.update(entity.getId(), entity, entity.isOnlyUrl() ? CmsContentAdminController.ignoreProperties
: CmsContentAdminController.ignorePropertiesWithUrl);
if (null != entity.getId()) {
logOperateService
.save(new LogOperate(site.getId(), user.getId(), LogLoginService.CHANNEL_WEB, "update.content",
RequestUtils.getIpAddress(request), CommonUtils.getDate(), JsonUtils.getString(entity)));
}
}
} else {
entity.setContribute(true);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册