Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -131,14 +131,6 @@ |
132 | 132 | 'depth' => array( 'review' => 2 ), |
133 | 133 | 'style' => array( 'review' => 3 ), |
134 | 134 | ); |
135 | | -# Use this to make levels of flags only appear if the page configured to |
136 | | -# select the stable version in a certain way. Array of tags=>level=>config. |
137 | | -$wgFlagAvailability = array(); |
138 | | -/* (example usage) |
139 | | -$wgFlagAvailability = array( |
140 | | - 'style' => array( 1=>FLAGGED_VIS_LATEST, 2=>FLAGGED_VIS_QUALITY ) |
141 | | -); |
142 | | -*/ |
143 | 135 | |
144 | 136 | # At what level of review do patrol marks go away? |
145 | 137 | # 0 => sighted; 1 => quality; 2 => pristine |
Index: trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php |
— | — | @@ -713,17 +713,14 @@ |
714 | 714 | public static function userCan( $tag, $value, $config = null ) { |
715 | 715 | global $wgUser; |
716 | 716 | $restrictions = FlaggedRevs::getTagRestrictions(); |
717 | | - # Levels may not apply for some pages. |
718 | | - # Skip this check if $config is not given. |
719 | | - if ( !is_null( $config ) && !self::levelAvailable( $tag, $value, $config ) ) { |
720 | | - return false; |
721 | | - } |
722 | 717 | # No restrictions -> full access |
723 | | - if ( !isset( $restrictions[$tag] ) ) |
| 718 | + if ( !isset( $restrictions[$tag] ) ) { |
724 | 719 | return true; |
| 720 | + } |
725 | 721 | # Validators always have full access |
726 | | - if ( $wgUser->isAllowed( 'validate' ) ) |
| 722 | + if ( $wgUser->isAllowed( 'validate' ) ) { |
727 | 723 | return true; |
| 724 | + } |
728 | 725 | # Check if this user has any right that lets him/her set |
729 | 726 | # up to this particular value |
730 | 727 | foreach ( $restrictions[$tag] as $right => $level ) { |
— | — | @@ -763,20 +760,6 @@ |
764 | 761 | return true; |
765 | 762 | } |
766 | 763 | |
767 | | - // Check if a given level for a tag is available in $config |
768 | | - public static function levelAvailable( $tag, $val, $config ) { |
769 | | - global $wgFlagAvailability; |
770 | | - if ( $val == 0 ) |
771 | | - return true; // unreviewed is always applicable |
772 | | - if ( !array_key_exists( 'select', $config ) ) |
773 | | - return true; // missing config |
774 | | - if ( isset( $wgFlagAvailability[$tag] ) && isset( $wgFlagAvailability[$tag][$val] ) ) { |
775 | | - $precedence = $wgFlagAvailability[$tag][$val]; |
776 | | - return ( $config['select'] === $precedence ); |
777 | | - } |
778 | | - return true; |
779 | | - } |
780 | | - |
781 | 764 | public static function updateRecentChanges( $title, $revId, $rcId = false, $patrol = true ) { |
782 | 765 | wfProfileIn( __METHOD__ ); |
783 | 766 | $revId = intval( $revId ); |