I think I’m trying to model things in a CRUD way, using RESTful
controller APIs as much as possible.
The background is this: many bulletin board systems allow users to
submit articles or make comments, but their contributions only appear
after a moderator has checked that they aren’t inflamatory, inciteful,
p*rnographic etc etc. I would like to implement a similar(ish) scheme,
but one that is generic.
I want users to be able to manipulate resources (e.g. submitting
articles, adding comments, updating details, deleting obsolete
information), but I want to implement the moderative process in a
generic way, i.e. one that can work with any resource whose controller
follows the RESTful API, and I want to be able to enforce moderation on
some, or all of the 4 CRUD operations (depending on the resource).
For a single type of resource, “articles” for example, it would be
tempting to implement a simple moderation system by including a column
in the “Articles” table that flags whether an article has passed
moderation. Then, only articles which are deemed to be okay (by the all
wise moderator) are displayed to users.
Fine, and simple enough to implement.
But what if I also want users to be able to delete articles? I would
like a moderator to have to okay the deletion before it occurs, so users
can’t delete any article they fancy, only ones whose deletion they can
justify.
The previous sentence gives a hint at the power a more sophisticated
system might provide: If an action (any of the 4 CRUDs) on any relevant
resources (e.g. articles, comments, users, pictures, tasks, etc etc) is
itself treated as a resource in a “meta” table–called perhaps,
“Requests”–then attributes of each request record might include
meta-data such as a text field where a user explains why they think an
action should be performed (i.e. users can justify their actions). Other
users can view proposed actions and provide peer-review of them (by
adding comments), and after some kind of consulation process (perhaps
even a vote) the action can either be binned or executed.
For example, think Wikipedia. A user wants to alter an entry. Rather
than just being allowed to do it, open their submission to peer review,
and only then decide whether the update should be allowed or not.
Similarly, a user finds an article offensive. They propose to delete it.
Other users (and administrators!) can view their arguments for deletion
and then decide whether to act or not.
Many collaborative systems cope well with Create and Read, so-so with
Update and not at all with Delete.
I’m trying to figure out the design of the “Request” table, and the
interaction with moderated Controller and Model classes.
I’m also trying to find out if there’s a much more obvious, but
nonetheless powerful, way of doing this that someone cleverer than me
can suggest.
Nat