创建、批准、编辑、批准网站内容模式

发布于 2024-08-13 23:04:15 字数 395 浏览 4 评论 0原文

我正在修改一个网站以允许用户输入内容。但是,一旦他们创建了该内容,就需要先获得批准才能发布。通过在该内容的记录中设置“中等”位,可以很容易地实现这一点,并且只需要一个表。

现在我还想允许用户像 StackOverflow 上一样编辑内容。但是,每次编辑都需要经过批准并存储,以便可以查看编辑历史记录。

在编辑等待批准时阻止对“实时”记录进行编辑是可以接受的,因此等待编辑的冲突不是问题。

我的目的是将每个项目的先前版本的集合保留在一个单独的表中,并将待处理的编辑放在该表中,直到批准/拒绝,然后如果批准则与主表中的记录交换。

谁能看出这个模式有什么缺陷吗?你能想出更好的方法来做到这一点吗?

虽然我认为这不相关,但我使用 C# 和 ASP.NET MVC 和 SQL Server 作为数据存储。

I'm working on a modification to a site to allowing users to enter content. However, once they've created that content it needs to be approved before it can be published. This is fairly easy to achieve by having a "moderate" bit set in the record for that content and only one table is needed.

Now I also want to allow users to edit the content much like here on StackOverflow. However, each edit needs to be approved as well as being stored so that a history of edits can be viewed.

It is acceptable to prevent editing to the "live" record while an edit is pending approval so conflict of pending edits is not an issue.

My intention is to keep the collection of previous versions of each item in a separate table and have the pending edit sit in this table until approved/rejected and then if approved swapped with the record in the main table.

Can anyone see any flaws in this pattern? Can you think of a better way to do this?

Although I don't think that it's relevant I'm using C# with ASP.NET MVC and SQL Server as the data store.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

你在我安 2024-08-20 23:04:15

我脑子里唯一想到的就是时机。

如果编辑时间紧迫,例如促销或优惠,那么审批流程也需要非常迅速。

您可能需要考虑构建电子邮件功能或优先级标志,以便及时批准编辑。

另一个考虑因素(我不知道时间是否允许)可能是合并 Windows Workflow Foundation。您可以将编辑记录 ID 附加到工作流程项目,然后由该工作流程项目处理审批的及时性。

这还意味着,如果审批者不在,其他人可以接听它,因为它是一个具有队列的工作流程项目,如果您是队列成员,您将看到它。

我知道这需要做很多工作,但我认为比仅仅依靠某人来批准变更更好的解决方案。

About the only things that springs to my mind is timing.

If the edit is time critical, like a promotion or offer, then the approval process will need to be pretty snappy also.

You may want to consider building in an email function, or priority flag, so that edits can be approved in a timely manner.

One other consideration, and I don't know if time allows for this, is to maybe incorporate Windows Workflow Foundation. You could attach the edit record id to a workflow item that then handles the timeliness of the approval.

It also means that if an approver is away, that someone else could pick it up as it's a workflow item that has a queue and if you are a member of the queue you'll see it.

I know that's a heck of a lot more work but I think a better solution than just relying on someone to come along and approve the change.

时常饿 2024-08-20 23:04:15

怎么样:

  • 一张表用于项目,一张表用于所有修订。修订版有一个已批准标志。
  • 看法
    • 用户可以获得最新批准的修订版。
    • 版主可以获得最新修订版以及批准它的选项。
  • 编辑
    • 当存在比最新批准的修订版更新的修订版时,用户将禁用。
    • 始终为版主启用。
  • 历史
    • 仅向用户显示已批准的修订。
    • 向版主显示所有修订。

在编辑等待批准时阻止对“实时”记录进行编辑是可以接受的,因此等待编辑的冲突不是问题。

我知道有一个网站是做这个的。我个人觉得很烦人。我希望他们这样做:

  • 一张表用于项目,一张表用于所有修订。修订版有一个已批准标志。
  • 看法
    • 客人可以获得最新批准的修订版。
    • 注册用户可以在最新版本和最新批准版本之间进行选择。
    • 版主可以获得最新修订版以及批准它的选项。
  • 编辑
    • 禁止访客使用。
    • 用户可以修改最新版本(批准或未批准)。
    • 始终为版主启用。
  • 历史
    • 仅向访客显示已批准的修订。
    • 向版主和注册用户显示所有修订。

What about something like this:

  • One table for the items and one table for all revisions. The revisions have an approved flag.
  • View
    • Users get the latest approved revision.
    • Moderators get the latest revision and the option to approve it.
  • Edit
    • Disabled for users when there is a newer revision than the latest approved revision.
    • Always enabled for moderators.
  • History
    • Shows only approved revisions to users.
    • Shows all revisions to moderators.

It is acceptable to prevent editing to the "live" record while an edit is pending approval so conflict of pending edits is not an issue.

I know a website that does this. I personally find it very annoying. I wish they'd do it like this:

  • One table for the items and one table for all revisions. The revisions have an approved flag.
  • View
    • Guests get the latest approved revision.
    • Registered users can choose between the latest and the latest approved revision.
    • Moderators get the latest revision and the option to approve it.
  • Edit
    • Disabled for guests.
    • Users can revise the latest revision (approved or not).
    • Always enabled for moderators.
  • History
    • Shows only approved revisions to guests.
    • Shows all revisions to moderators and registered users.
五里雾 2024-08-20 23:04:15

我曾与一些主要的商业 CMS 合作过,我不记得他们的任何工作流程在批准后创建内容的物理副本。不过,我认为这是一个诱人的想法。您希望防止未经批准的内容泄露到公开场合等,但我认为这样做没有很好的技术理由(除非您期望内容如此之多,以至于将其划分为已发布和未发布的集合具有性能优势) 。

我不认为你的方法有什么特别错误的地方。但你无缘无故地复制数据。

I have worked with a few of the major commercial CMS, and I don't remember any of their workflows creating a physical copy of the content when it is approved. I can see that it is a tempting idea, though. You want to prevent unapproved content from leaking out into the open, etc, but I don't think there is a good technical reason for doing that (unless you expect so much content that partitioning it into published and unpublished sets has a performance benefit).

I don't think that there is anything particularly wrong with your approach. But you are duplicating data for no good reason.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文