When reviewing flags, either from the queue or from the flagged post, I often want to know what the flagger could have done in addition to, or instead of, flagging for mod attention. Does he have the rep to downvote? To comment? To vote to delete? Knowing this doesn't necessarily affect how I handle the flag, but if there's a possible teaching moment there I use the flag response to point it out.

But I can't find this out unless I click through to the user's profile (unless I already know this user, of course). Would it be possible to get the flagger's reputation in a tooltip, like what's already done for comments?


I've written a script to do just this:

$('.flag-row a').each(function() {
    var user = $(this);
    var userId = user.attr('href').match(/\d+/)[0];
    $.get('/help/privileges/user/' + userId, function(data){
        var privRe = /<div class="privilege-table-row " data-href="\/help\/privileges\/([a-z-]+)">/g, priv = null, privs = [];
        while (priv = privRe.exec(data)) {
        user.text(user.text() + ' [' + privs.map(function(p) {
            return ({
                trusteduser: 'delete',
                moderatortools: 'delete(ish)',
                edit: 'edit',
                closequestions: 'close',
                votedown: 'downvote',
                comment: 'comment'
            })[p.replace('-', '')];
        }).join(' ').trim() + ']');

And here's a minified and userscript-ified version (make sure you replace YOURSITE with the site you're a mod on in the header):

// ==UserScript==
// @name Show privileges in flag queue
// @grant none
// @match *://YOURSITE.stackexchange.com/admin/dashboard
// ==/UserScript==
var userscript = function($) {
$(".flag-row a").each(function(){var a=$(this),b=a.attr("href").match(/\d+/)[0];$.get("/help/privileges/user/"+b,function(b){for(var e=/<div class="privilege-table-row " data-href="\/help\/privileges\/([a-z-]+)">/g,c=null,d=[];c=e.exec(b);)d.push(c[1]);a.text(a.text()+" ["+d.map(function(a){return{trusteduser:"delete",moderatortools:"delete(ish)",edit:"edit",closequestions:"close",votedown:"downvote",comment:"comment"}[a.replace("-","")]}).join(" ").trim()+"]")})});
var el = document.createElement('script');
el.type = 'text/javascript';
el.text = '(' + userscript + ')(jQuery);';

You can save it as something.user.js and then drag it into Chrome's chrome://extensions page (drag'n'drop may or may not work in other browsers).

Here's a screenshot (link only viewable to mods, because it contains sekrits).

Unfortunately, it won't work on meta sites due to same-origin policy, but that's okay because meta flags are pretty rare anyway.

It also doesn't work on comment flags, since you can't see the flagger of a comment.

|improve this answer|||||

I agree. This would be particularly useful for flags requesting corrective action that rep privileges grant. With such flags, we may dismiss as helpful for users without that privilege but decline for ones that do.

|improve this answer|||||

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .