Revision hiding

    Introduction and purpose

    Currently page revert is the only way to remove an inflammatory edit, vandalism, or spam from a page. Although this does give moderators and wiki administrators some control, more power and flexibility is often needed to maintain quality and professionalism in a publicly facing wiki. This feature gives moderators the ability to hide a page or file revision from users.

    A secondary goal for this feature is to allow for a means of attribution for the new page drafts and publishing feature. A moderator will be able to identify key contributors to a draft page and hide redundant and extraneous revisions of a draft before publishing. Publishing would then copy all remaining revisions with the original editors preserved.

    Intended Audience

    This feature is mainly intended for public sites that require a means of cleaning up spam or inappropriate contributions in the history of pages and attachments. This feature will also tie in closely with the drafts and moderation system as a means of attributing users with changes they performed in a draft copy.

    This will become a core feature available to all releases of MindTouch.

    Status

    Requirements established. Implementation specs being discussed

    Use Cases

    • Hide one or more revisions of a file or page
    • Unhide one or more revisions of a file or page
    • See all non hidden revisions of a file or page
    • See hidden and non hidden revisions of a file or page
    • Access the head revision of a file or page that has the latest revision hidden as a moderator and non moderator
    Functional Specification
    • Hiding the head revision is not allowed
    • Reverting a hidden page revision is not possible (return status: conflict)
    • Hiding a file revision that did not have a content change (delete, restore, move) is not possible (return status: conflict)

    Non-goals

    • Hiding the head revisions of pages or files is not going to be allowed at least in the initial implementation.

    Technical Specification

    UI requirements

    • Allow moderator to delete 1 or more revisions from the page history view
    • A moderator is able to see the contents of a hidden rev
      • UI needs to display a message indicating that the revision being looked at is hidden

    API requirements

    API interface changes

    New features

    • New features: POST:page/{id}/revisions
    • New features: POST:file/{id}/revisions

    Query Param: comment

    Request body for pages:

    <revisions>
        <page id="y" revision="x" hidden="{bool}" />
    </revisions>

    Request body for files:

    <revisions>
        <files id="y" revision="x" hidden="{bool}" />
    </revisions>

    Page revision XML unhidden (unchanged elements are left out)

    <page id="1" revision="200" href="http://developer.mindtouch.com/@api/deki/pages/1/revisions?revision=200&redirects=0">
        <contents type="application/x.deki0805+xml" href="http://developer.mindtouch.com/@api/deki/pages/1/contents?revision=200&redirects=0"/>
        <title>my report</title>
        <description>updated the figures</description>
    </page>

    Hidden revision of a page

    <page id="1" revision="200" hidden="true" href="http://developer.mindtouch.com/@api/deki/pages/1/revisions?revision=200&redirects=0">
        <contents type="application/x.deki0805+xml" href="http://developer.mindtouch.com/@api/deki/pages/1/contents?revision=200&redirects=0"/>
        <title hidden="true">default title</title>
        <description hidden="true"/>
    
        <user.hiddenby id=100>
                <name>foo</name>
        </user.hiddenby>
        <date.hidden>2009-05-22T00:44:26Z</date.hidden>
        <description.hidden>spam revision</description.hidden>
    </page>

    File revision XML unhidden (unchanged elements are left out)

    <file id="100" revision="1" href="http://developer.mindtouch.com/@api/deki/files/100/info?revision=1>
        <contents type="application/vnd.ms-excel" size="13824" href="http://developer.mindtouch.com/@api/deki/files/100/=Kitap1.xls?revision=1"/>
        <description>fixed the figures</description>
    </file>

    Hidden revision of a file

    <file id="100" revision="1" hidden="true" href="http://developer.mindtouch.com/@api/deki/files/100/info?revision=1>
        <contents type="application/vnd.ms-excel" size="13824" href="http://developer.mindtouch.com/@api/deki/files/100/=Kitap1.xls?revision=1"/>
        <description hidden="true"/>       
        <date.hidden>2009-05-22T00:44:26Z</date.hidden>    
        <user.hiddenby id="100">
            <name>foo</name>
        </user.hidden>
        <description.hidden>spam revision</description.hidden>
    </file>
    Permissions enforcement
    • Only users with DELETE rights are able to hide revisions of a page or file
    • Only users with ADMIN rights are able to see hidden revisions of a page or file
    • Only users with ADMIN rights are able to restore hidden revisions of a page or file
    Revision information
    • Hidden revisions expose who hid them, when, and an optional comment
    • Revision count includes hidden revisions regardless of access
    • Hidden revisions do not expose TOC, summary, content, edit summary to non admins. Everything else about the revision including the editor, timestamp, etc is still exposed.
    Search

    Search is not affected since hiding head revisions is not allowed

    Notifications

    TODO

    Recent Changes and Feeds

    Feeds do not display page edits that were afterwards marked as hidden. This includes the aggregate recentchanges, page, watchlist, and user contributions feeds. This affects admin as well as normal users.

    DB Schema Requirements

    Table: Pages
    • new column: page_is_hidden (tinyint)
    • new column: page_meta (text) nullable
    Table: Old
    • new column: old_is_hidden (tinyint)
    • new column: old_meta (text) nullable
    Table: Archive
    • new column: ar_is_hidden (tinyint)
    • new column: ar_meta (text) nullable
    Table: Resources
    • new column: resrev_is_hidden (tinyint)
    Table: Resourcerevs
    • new column: resrev_is_hidden (tinyint)

     

    Upgrade SQL
    alter table `old` add column `old_is_hidden` tinyint UNSIGNED DEFAULT '0' NOT NULL;
    alter table `old` add column `old_meta` text NULL COLLATE utf8_general_ci;
    alter table `archive` add column `ar_is_hidden` tinyint UNSIGNED DEFAULT '0' NOT NULL;
    alter table `archive` add column `ar_meta` text NULL COLLATE utf8_general_ci;
    alter table `pages` add column `page_is_hidden` tinyint UNSIGNED  DEFAULT '0' NOT NULL;
    alter table `pages` add column `page_meta` text   NULL  COLLATE utf8_general_ci;
    alter table `resources` add column `resrev_ishidden` tinyint UNSIGNED DEFAULT '0' NOT NULL after `resrev_language`;
    alter table `resourcerevs` add column `resrev_ishidden` tinyint UNSIGNED DEFAULT '0' NOT NULL after `resrev_language`;
    

    Open questions

    • Recent changes contain the page edit summary. Should it be exposed via rss for hidden revs?

     

    Tag page
    Viewing 1 of 1 comments: view all
    I still think the hidden attribute should just be on the main element and avoid the redundant hidden attributes across all the other elements. i.e. <description hidden="true" /> => <description />. I also think the xml should always have the hidden attribute for revisions. <page hidden="false" /> <page hidden="true"/> edited 19:09, 2 Jun 2009
    Posted 19:08, 2 Jun 2009
    Viewing 1 of 1 comments: view all
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by