Is it possible to hide the who's online module from the member role ?

I have a prospect that is looking to hide the who's online module from appearing to regular members but want the Admin/Mods to be able to see.

Shauna seemed to think it may be possible with If Statements but if I could some specific it would really help me out.

@Rhys @Isis @Irina


Comments

  • If the client has a custom theme they can use the themehooks to output the session user roles as body CSS classes and hide the "Who's Online Module" on with CSS using those classes.

  • So in a situation where they are using customize theme they can't because they don't have the ability to make a theme hook?

    Is there anything in the Gdn.meta they could use?


  • What about dem dere smarty tags? Is it possible to identify roles or users with a smarty tag?

    If not, what about restricting the Who's Online module to only show up in a specific category, then restricting access to the category?

  • @BrendanParm using gdn.meta I believe this would work:

    for(var i = 0; i < gdn.meta.Roles.length; i++) {
        var role = (gdn.meta.Roles[i]).replace(' ', '');
        $('body').addClass('Role_'gdn.meta.Roles[i]);
    }
    

    The code above can be added to a pocket and add user's roles to the body tag. From that you can use it to hide the "Who's Online Module" with CSS.