working on per-user permissions

This commit is contained in:
John Bintz 2009-10-14 20:49:31 -04:00
parent 1f98d874c4
commit b274c28d03
4 changed files with 41 additions and 6 deletions

View File

@ -908,6 +908,8 @@ class WhatDidTheySayAdmin {
$available_filters = $this->_get_available_override_filters(); $available_filters = $this->_get_available_override_filters();
$suggested_amount = 20 + ($this->transcript_count * 0.1); $suggested_amount = 20 + ($this->transcript_count * 0.1);
$users = $wpdb->get_results("SELECT ID, user_login from $wpdb->users ORDER BY user_login");
include('partials/admin.inc'); include('partials/admin.inc');
} }

View File

@ -29,5 +29,42 @@
</tr> </tr>
</table> </table>
</form> </form>
<h3><?php _e('Per-user Permissions', 'what-did-they-say') ?></h3>
<p><?php _e('Give specified users permissions above and beyond their role permissions.', 'what-did-they-say') ?></p>
<form method="post">
<input type="hidden" name="wdts[_nonce]" value="<?php echo $nonce ?>" />
<input type="hidden" name="wdts[module]" value="user-capabilities" />
<table class="widefat fixed">
<tr>
<th width="15%">Login</th>
<th colspan="3">Capabilities</th>
</tr>
<?php foreach ((array)$users as $user) {
$user_capabilities = get_usermeta($user->ID, 'transcript_capabilities');
if (!is_array($user_capabilities)) { $user_capabilities = array(); }
?>
<tr>
<th scope="row"><?php echo $user->user_login ?></th>
<?php foreach ($this->capabilities as $key => $label) { ?>
<td>
<label style="white-space: nowrap">
<input type="checkbox" name="wdts[user_capabilities][<?php echo $user->ID ?>][<?php echo $key ?>]" value="yes" />
<?php echo $label ?>
</label>
</td>
<?php } ?>
</tr>
<?php } ?>
<tr>
<td>&nbsp;</td>
<td colspan="3">
<input type="submit" value="<?php _e('Update per-user permissions', 'what-did-they-say') ?>" />
</td>
</tr>
</table>
</form>
<?php } ?> <?php } ?>

View File

@ -61,10 +61,6 @@ class WhatDidTheySayAdminTest extends PHPUnit_Framework_TestCase {
'change_languages' => 'reader' 'change_languages' => 'reader'
), $result['capabilities']); ), $result['capabilities']);
} }
function testHandleUpdateLanguages() {
$this->markTestIncomplete();
}
} }
?> ?>

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: what-did-they-say 0.9.1\n" "Project-Id-Version: what-did-they-say 0.9.1\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-10-14 07:54-0400\n" "POT-Creation-Date: 2009-10-14 08:16-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -16,7 +16,7 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n" "Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: what-did-they-say.php:207 #: what-did-they-say.php:217
msgid "Edit/Add Transcripts" msgid "Edit/Add Transcripts"
msgstr "" msgstr ""