Changeset 6287 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-capabilities.php
- Timestamp:
- 12/19/2017 04:22:37 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-capabilities.php
r5867 r6287 1 1 <?php 2 2 namespace WordPressdotorg\Plugin_Directory; 3 3 4 use WordPressdotorg\Plugin_Directory\Tools; 4 5 … … 23 24 public static function map_meta_cap( $required_caps, $cap, $user_id, $context ) { 24 25 $plugin_edit_cap = false; 25 switch ( $cap ) {26 switch ( $cap ) { 26 27 case 'plugin_admin_edit': 27 28 case 'plugin_add_committer': … … 30 31 case 'plugin_remove_support_rep': 31 32 $plugin_edit_cap = true; 33 32 34 // Fall through 33 34 // Although we no longer have a admin view, this capability is still used to determine if the current user is a committer/contributor. 35 // Although we no longer have a admin view, this capability is still used to determine if the current user is a committer/contributor. 35 36 case 'plugin_admin_view': 36 37 // Committers + Contributors. 37 38 // If no committers, post_author. 38 39 $required_caps = array(); 39 $post = get_post( $context[0] );40 $post = get_post( $context[0] ); 40 41 41 42 if ( ! $post ) { … … 98 99 */ 99 100 public static function add_roles() { 100 101 101 $reviewer = array( 102 102 'read' => true, … … 121 121 // Remove the roles first, incase we've changed the permission set. 122 122 remove_role( 'plugin_reviewer' ); 123 remove_role( 'plugin_admin' 124 add_role( 'plugin_reviewer', 125 add_role( 'plugin_admin', 'Plugin Admin', $admin);123 remove_role( 'plugin_admin' ); 124 add_role( 'plugin_reviewer', 'Plugin Reviewer', $reviewer ); 125 add_role( 'plugin_admin', 'Plugin Admin', $admin ); 126 126 127 127 $wp_admin_role = get_role( 'administrator' ); … … 135 135 } 136 136 } 137
Note: See TracChangeset
for help on using the changeset viewer.