r108897 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108896‎ | r108897 | r108898 >
Date:12:54, 14 January 2012
Author:jeroendedauw
Status:deferred (Comments)
Tags:
Comment:
work on permissions and usergroups
Modified paths:
  • /trunk/extensions/EducationProgram/EducationProgram.i18n.php (modified) (history)
  • /trunk/extensions/EducationProgram/EducationProgram.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php
@@ -58,28 +58,42 @@
5959 'ep-prefs-showtoplink' => 'Show a link to [[Special:MyCourses|your courses]] at the top of every page.',
6060
6161 // Rights
62 - 'right-epadmin' => 'Manage the education program',
63 - 'right-epstudent' => 'Enroll in the education program',
64 - 'right-epmentor' => 'Mentor in the education program',
 62+ 'right-ep-org' => 'Manage Education Program institutions',
 63+ 'right-ep-course' => 'Manage Education Program courses',
 64+ 'right-ep-term' => 'Manage Education Program terms',
 65+ 'right-ep-token' => 'See Education Program enrollment tokens',
 66+ 'right-ep-remstudent' => 'Remove students from terms',
 67+ 'right-ep-enroll' => 'Enroll in Education Program terms',
6568
6669 // Actions
67 - 'action-epadmin' => 'manage the education program',
68 - 'action-epstudent' => 'enroll in the education program',
69 - 'action-epmentor' => 'mentor in the education program',
 70+ 'right-ep-org' => 'manage institutions',
 71+ 'right-ep-course' => 'manage courses',
 72+ 'right-ep-term' => 'manage terms',
 73+ 'right-ep-token' => 'see enrollment tokens',
 74+ 'right-ep-remstudent' => 'remove students from terms',
 75+ 'right-ep-enroll' => 'enroll in terms',
7076
7177 // Groups
7278 'group-epadmin' => 'Education program admins',
73 - 'group-epadmin-member' => '{{GENDER:$1|education program admin}}',
 79+ 'group-epadmin-member' => '{{GENDER:$1|Education Program admin}}',
7480 'grouppage-epadmin' => '{{ns:project}}:Education_program_administrators',
7581
76 - 'group-epstudent' => 'Education program students',
77 - 'group-epstudent-member' => '{{GENDER:$1|education program student}}',
78 - 'grouppage-epstudent' => '{{ns:project}}:Education_program_students',
 82+ 'group-epstaff' => 'Education program staff',
 83+ 'group-epstaff-member' => '{{GENDER:$1|Education Program staff}}',
 84+ 'grouppage-epstaff' => '{{ns:project}}:Education_program_staff',
7985
80 - 'group-epmentor' => 'Education program ambassadors',
81 - 'group-epmentor-member' => '{{GENDER:$1|education program ambassador}}',
82 - 'grouppage-epmentor' => '{{ns:project}}:Education_program_ambassadors',
 86+ 'group-eponlineamb' => 'Education program online ambassador',
 87+ 'group-eponlineamb-member' => '{{GENDER:$1|Education Program online ambassador}}',
 88+ 'grouppage-eponlineamb' => '{{ns:project}}:Education_program_online_ambassadors',
8389
 90+ 'group-epcampamb' => 'Education program campus ambassador',
 91+ 'group-epcampamb-member' => '{{GENDER:$1|Education Program campus ambassador}}',
 92+ 'grouppage-epcampamb' => '{{ns:project}}:Education_program_campus_ambassadors',
 93+
 94+ 'group-epinstructor' => 'Education program instructor',
 95+ 'group-epinstructor-member' => '{{GENDER:$1|Education Program instructor}}',
 96+ 'grouppage-epinstructor' => '{{ns:project}}:Education_program_instructors',
 97+
8498 // Special pages
8599 'specialpages-group-education' => 'Education',
86100 'special-mycourses' => 'My courses',
Index: trunk/extensions/EducationProgram/EducationProgram.php
@@ -152,39 +152,58 @@
153153 $wgLogActionsHandlers['course/*'] = 'LogFormatter';
154154 $wgLogActionsHandlers['term/*'] = 'LogFormatter';
155155
156 -// Rights
157 -$wgAvailableRights[] = 'epadmin';
158 -$wgAvailableRights[] = 'epstudent';
159 -$wgAvailableRights[] = 'epmentor';
 156+$wgAvailableRights[] = 'ep-org'; // Manage orgs
 157+$wgAvailableRights[] = 'ep-course'; // Manage courses
 158+$wgAvailableRights[] = 'ep-term'; // Manage terms
 159+$wgAvailableRights[] = 'ep-token'; // See enrollment tokens
 160+$wgAvailableRights[] = 'ep-enroll'; // Enroll as a student
 161+$wgAvailableRights[] = 'ep-remstudent'; // Dissasociate students from terms
160162
161 -# Users that can manage the education program.
162 -$wgGroupPermissions['*' ]['epadmin'] = false;
163 -// $wgGroupPermissions['user' ]['epadmin'] = false;
164 -// $wgGroupPermissions['autoconfirmed']['epadmin'] = false;
165 -// $wgGroupPermissions['bot' ]['epadmin'] = false;
166 -$wgGroupPermissions['sysop' ]['epadmin'] = true;
167 -$wgGroupPermissions['epadmin' ]['epadmin'] = true;
 163+$wgGroupPermissions['*']['ep-org'] = false;
 164+$wgGroupPermissions['*']['ep-course'] = false;
 165+$wgGroupPermissions['*']['ep-term'] = false;
 166+$wgGroupPermissions['*']['ep-token'] = false;
 167+$wgGroupPermissions['*']['ep-remstudent'] = false;
 168+$wgGroupPermissions['*']['ep-enroll'] = true;
168169
169 -# Users that can enroll as students in the education program.
170 -$wgGroupPermissions['*' ]['epstudent'] = false;
171 -$wgGroupPermissions['user' ]['epstudent'] = true;
172 -// $wgGroupPermissions['autoconfirmed']['epstudent'] = true;
173 -// $wgGroupPermissions['bot' ]['epstudent'] = false;
174 -$wgGroupPermissions['sysop' ]['epstudent'] = true;
175 -$wgGroupPermissions['epadmin']['epstudent'] = true;
176 -$wgGroupPermissions['epstudent' ]['epstudent'] = true;
177 -$wgGroupPermissions['epmentor' ]['epstudent'] = true;
 170+$wgGroupPermissions['epstaff']['ep-org'] = true;
 171+$wgGroupPermissions['epstaff']['ep-course'] = true;
 172+$wgGroupPermissions['epstaff']['ep-term'] = true;
 173+$wgGroupPermissions['epstaff']['ep-token'] = true;
 174+$wgGroupPermissions['epstaff']['ep-enroll'] = true;
 175+$wgGroupPermissions['epstaff']['ep-remstudent'] = true;
178176
179 -# Users that act as mentors in the education program.
180 -$wgGroupPermissions['*' ]['epmentor'] = false;
181 -$wgGroupPermissions['user' ]['epmentor'] = true;
182 -// $wgGroupPermissions['autoconfirmed']['epmentor'] = true;
183 -// $wgGroupPermissions['bot' ]['epmentor'] = false;
184 -$wgGroupPermissions['sysop' ]['epmentor'] = true;
185 -$wgGroupPermissions['epadmin']['epmentor'] = true;
186 -$wgGroupPermissions['epmentor' ]['epmentor'] = true;
 177+$wgGroupPermissions['epadmin']['ep-org'] = true;
 178+$wgGroupPermissions['epadmin']['ep-course'] = true;
 179+$wgGroupPermissions['epadmin']['ep-term'] = true;
 180+$wgGroupPermissions['epadmin']['ep-token'] = true;
 181+$wgGroupPermissions['epadmin']['ep-enroll'] = true;
 182+$wgGroupPermissions['epadmin']['ep-remstudent'] = true;
187183
 184+$wgGroupPermissions['eponlineamb']['ep-org'] = true;
 185+$wgGroupPermissions['eponlineamb']['ep-course'] = true;
 186+$wgGroupPermissions['eponlineamb']['ep-term'] = true;
 187+$wgGroupPermissions['eponlineamb']['ep-token'] = true;
188188
 189+$wgGroupPermissions['epcampamb']['ep-org'] = true;
 190+$wgGroupPermissions['epcampamb']['ep-course'] = true;
 191+$wgGroupPermissions['epcampamb']['ep-term'] = true;
 192+$wgGroupPermissions['epcampamb']['ep-token'] = true;
 193+
 194+$wgGroupPermissions['epinstructor']['ep-org'] = true;
 195+$wgGroupPermissions['epinstructor']['ep-course'] = true;
 196+$wgGroupPermissions['epinstructor']['ep-term'] = true;
 197+$wgGroupPermissions['epinstructor']['ep-token'] = true;
 198+$wgGroupPermissions['epinstructor']['ep-remstudent'] = true;
 199+
 200+$wgGroupPermissions['epstaff']['userrights'] = false;
 201+$wgAddGroups['epstaff'] = array( 'epstaff', 'epadmin', 'eponlineamb', 'epcampamb', 'epinstructor' );
 202+$wgRemoveGroups['epstaff'] = array( 'epstaff', 'epadmin', 'eponlineamb', 'epcampamb', 'epinstructor' );
 203+
 204+$wgGroupPermissions['epadmin']['userrights'] = false;
 205+$wgAddGroups['epadmin'] = array( 'eponlineamb', 'epcampamb', 'epinstructor' );
 206+$wgRemoveGroups['epadmin'] = array( 'eponlineamb', 'epcampamb', 'epinstructor' );
 207+
189208 // Resource loader modules
190209 $moduleTemplate = array(
191210 'localBasePath' => dirname( __FILE__ ) . '/resources',

Follow-up revisions

RevisionCommit summaryAuthorDate
r108898Follow up to r108897;jeroendedauw13:02, 14 January 2012

Comments

#Comment by Siebrand (talk | contribs)   12:57, 14 January 2012

You appear to have duplicated right-ep-* at the cost of action-ep-*. That doesn't look rights.

Just a warning: Plan some serious time for your message documentation (about 1 minute per message), as you appear to postpone that for some reason.

#Comment by Jeroen De Dauw (talk | contribs)   13:04, 14 January 2012

Like I noted several times before, there is no point in me adding message docs at this point, since the extension is not being translated yet, and messages are prone to change. This commit just proves I saved myself the trouble of documenting several messages that now got replaced. I will document everything once this is feature complete and translation starts. That way you'll even end up with better docs and not miss docs for some messages as tends to happen if you add them on per message basis.

Status & tagging log