summaryrefslogtreecommitdiff
path: root/plugins/UserFlag/UserFlagPlugin.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-12-27 11:04:53 -0800
committerEvan Prodromou <evan@status.net>2009-12-27 11:04:53 -0800
commit5d6b6bfd3494a7829c8fdccfdf85278811db83c8 (patch)
tree72ca422c3972a4f15fa4eb1d0534f29d237d1aeb /plugins/UserFlag/UserFlagPlugin.php
parent1a462b04d7594159e90b514538ddbe3f7effd7f8 (diff)
admin page checks for right to review flags
Diffstat (limited to 'plugins/UserFlag/UserFlagPlugin.php')
-rw-r--r--plugins/UserFlag/UserFlagPlugin.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/UserFlag/UserFlagPlugin.php b/plugins/UserFlag/UserFlagPlugin.php
index 75dcca4fc..b4f9bd783 100644
--- a/plugins/UserFlag/UserFlagPlugin.php
+++ b/plugins/UserFlag/UserFlagPlugin.php
@@ -43,6 +43,8 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
class UserFlagPlugin extends Plugin
{
+ const REVIEWFLAGS = 'UserFlagPlugin::reviewflags';
+
function onCheckSchema()
{
$schema = Schema::get();
@@ -138,7 +140,7 @@ class UserFlagPlugin extends Plugin
function onEndShowStatusNetStyles($action)
{
- $action->cssLink(common_path('plugins/UserFlag/userflag.css'),
+ $action->cssLink(common_path('plugins/UserFlag/userflag.css'),
null, 'screen, projection, tv');
return true;
}
@@ -148,4 +150,12 @@ class UserFlagPlugin extends Plugin
$action->inlineScript('if ($(".form_entity_flag").length > 0) { SN.U.FormXHR($(".form_entity_flag")); }');
return true;
}
+
+ function onUserRightsCheck($user, $right, &$result) {
+ if ($right == self::REVIEWFLAGS) {
+ $result = $user->hasRole('moderator');
+ return false; // done processing!
+ }
+ return true; // unchanged!
+ }
}