Skip to content
Yannouk edited this page Jul 5, 2012 · 1 revision

Table of Contents

What ABOUT this functionality identity?

  • Abstraction level:Medium
  • State: In progress

WHAT?

  • ID: F20110
  • Story: User sets rights
  • Priority: High
  • Development Time: 5 Days
  • Maintenance Time: 0

WHO?

  • This page was created by Yannouk on 2012.01.18.

What is the POSITION of this functionality?

PARENTS?

  • F20105 User uploads a file - Planned - Critical
  • F50150 Artist edits a file - Planned - Critical

CHILDREN?

  • none

What is BEFORE?

  • none

What comes AFTER?

  • none

What are its FUNCTIONAL REQUIREMENTS?

PRECONDITIONS?

  • the page/image

REQUIREMENTS?

  • the author of a page/file can set the read right to:
    • everyone can read/see it
    • only the author (me) can read/see it
  • the author of a page/file can set the write (=edit) right to:
    • everyone can edit/reupload a new version
    • only the author (me) can edit/reupload a new version

POSTCONDITIONS?

  • to be discussed

HOW is this functionality implemented?

  • Based mainly on AuthorProtect extension
  • Developped a "magic" UserCan hook, wich does the stuff

Brain snapshot

  • MediaWiki's built-in permissions architecture uses group-based permissions:
    • Users are assigned to groups
    • groups are assigned rights
    • -> users inherit rights from every group to which they are assigned)
  • In LocalSettings.php,
    $wgRevokePermissions['*']['read'] = true;
    seems to make the wiki private
  • When creating a page or uploading a file, by default:
    • it's public readable
    • only the author can edit
  • forbid page creation by anonym
  • talk only creatable by by owner of the main
    • Project_talk:Bienvenue only creatable by owner of Project:Bienvenue
    • Main_talk:Les_Gros_Fetards/La_chanson_du_lundi/version_anglaise
[11:56:05] Seizam Contact Line: Talk:Les_Gros_Fetards/La_chanson_du_lundi/version_anglaise
    • user is author -> user is owner (same behaviour)
    • only owner of WikiPlace
  • What EditPage does when submitting text changes?
    • when submitting form, call edit()
      • call attemptSave()
        • call internalAttemptSave()
          • call $this->mArticle->doEdit( $text, $this->summary, $flags )
            • WikiPage->doEdit( $text, $summary, $flags = 0, $baseRevId = false, $user = null )
              • call WikiPage->updateRevisionOn(...)
              • call WikiPage->doEditUpdates(...)
                • call WikiPage->onArticleEdit( $this->mTitle );
              • call WikiPage->mTitle->invalidateCache()
  • WikiPage->updateRestrictions(...)
    • wfRunHooks( 'NewRevisionFromEditComplete', array( $this, $nullRevision, $latest, $user ) );
    • wfRunHooks( 'ArticleProtectComplete', array( &$this, &$user, $limit, $reason ) );

Improvements for later

  • currently, none
Clone this wiki locally