Dzahn has submitted this change and it was merged.

Change subject: Allow authors to edit others' posts
......................................................................


Allow authors to edit others' posts

Change-Id: I09e0e8eb3530eb8f3eb04bb10dbff8f97b44d6f8
---
M WMBlog.php
1 file changed, 15 insertions(+), 1 deletion(-)

Approvals:
  Tychay: Looks good to me, approved
  Dereckson: Looks good to me, but someone else must approve
  Dzahn: Verified; Looks good to me, approved



diff --git a/WMBlog.php b/WMBlog.php
index cd02100..3732466 100644
--- a/WMBlog.php
+++ b/WMBlog.php
@@ -41,6 +41,15 @@
        $contributor->add_cap('upload_files');
 }
 
+/* =========================================================
+   Allow authors to edit others' posts
+   This setting is written to the database. */
+
+function WMBlog_allow_author_edit_others_posts() {
+       $author = get_role('author');
+       $author->add_cap('edit_others_posts');
+}
+
 
 /* =========================================================
    Replicate the default meta widget and extend it to include
@@ -115,7 +124,10 @@
 
 function WMBlog_setup() {
        // Allow contributors to upload files
-       WMBlog_allow_contributor_uploads();}
+       WMBlog_allow_contributor_uploads();
+       // Allow authors to edit other people's posts
+       WMBlog_allow_author_edit_others_posts();
+}
 
 
 /* =========================================================
@@ -126,7 +138,9 @@
 
 function WMBlog_cleanup(){
        global $wp_roles;
+       // Restore user rights to WordPress defaults
        $wp_roles->remove_cap( 'contributor', 'upload_files' );
+       $wp_roles->remove_cap( 'author', 'edit_others_posts' );
 }
 
 ?>
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/28835
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I09e0e8eb3530eb8f3eb04bb10dbff8f97b44d6f8
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/communications/WMBlog
Gerrit-Branch: master
Gerrit-Owner: Guillom <[email protected]>
Gerrit-Reviewer: Dereckson <[email protected]>
Gerrit-Reviewer: Dzahn <[email protected]>
Gerrit-Reviewer: Tychay <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to