Index: trunk/extensions/EducationProgram/includes/EPOrg.php |
— | — | @@ -136,8 +136,14 @@ |
137 | 137 | * |
138 | 138 | * @param IContextSource $context |
139 | 139 | * @param array $args |
| 140 | + * |
| 141 | + * @return boolean |
140 | 142 | */ |
141 | 143 | public static function displayAddNewControl( IContextSource $context, array $args = array() ) { |
| 144 | + if ( !$context->getUser()->isAllowed( 'epadmin' ) ) { |
| 145 | + return false; |
| 146 | + } |
| 147 | + |
142 | 148 | $out = $context->getOutput(); |
143 | 149 | |
144 | 150 | $out->addHTML( Html::openElement( |
— | — | @@ -171,6 +177,8 @@ |
172 | 178 | $out->addHTML( Html::hidden( 'newEditToken', $context->getUser()->editToken() ) ); |
173 | 179 | |
174 | 180 | $out->addHTML( '</fieldset></form>' ); |
| 181 | + |
| 182 | + return true; |
175 | 183 | } |
176 | 184 | |
177 | 185 | /** |
Index: trunk/extensions/EducationProgram/includes/EPTerm.php |
— | — | @@ -157,8 +157,14 @@ |
158 | 158 | * |
159 | 159 | * @param IContextSource $context |
160 | 160 | * @param array $args |
| 161 | + * |
| 162 | + * @return boolean |
161 | 163 | */ |
162 | 164 | public static function displayAddNewControl( IContextSource $context, array $args ) { |
| 165 | + if ( !$context->getUser()->isAllowed( 'epmentor' ) ) { |
| 166 | + return false; |
| 167 | + } |
| 168 | + |
163 | 169 | $out = $context->getOutput(); |
164 | 170 | |
165 | 171 | $out->addHTML( Html::openElement( |
— | — | @@ -197,6 +203,8 @@ |
198 | 204 | $out->addHTML( Html::hidden( 'newEditToken', $context->getUser()->editToken() ) ); |
199 | 205 | |
200 | 206 | $out->addHTML( '</fieldset></form>' ); |
| 207 | + |
| 208 | + return true; |
201 | 209 | } |
202 | 210 | |
203 | 211 | /** |
Index: trunk/extensions/EducationProgram/includes/EPCourse.php |
— | — | @@ -155,8 +155,14 @@ |
156 | 156 | * |
157 | 157 | * @param IContextSource $context |
158 | 158 | * @param array $args |
| 159 | + * |
| 160 | + * @return boolean |
159 | 161 | */ |
160 | 162 | public static function displayAddNewControl( IContextSource $context, array $args = array() ) { |
| 163 | + if ( !$context->getUser()->isAllowed( 'epmentor' ) ) { |
| 164 | + return false; |
| 165 | + } |
| 166 | + |
161 | 167 | $out = $context->getOutput(); |
162 | 168 | |
163 | 169 | $out->addHTML( Html::openElement( |
— | — | @@ -207,6 +213,8 @@ |
208 | 214 | $out->addHTML( Html::hidden( 'newEditToken', $context->getUser()->editToken() ) ); |
209 | 215 | |
210 | 216 | $out->addHTML( '</fieldset></form>' ); |
| 217 | + |
| 218 | + return true; |
211 | 219 | } |
212 | 220 | |
213 | 221 | /** |