Return to Snippet

Revision: 38342
at December 31, 2010 06:06 by joshuatravis


Initial Code
// -- User Groups
var groups = [ xml.text(gname) foreach var gname in wiki.api(site.api.."/users/"..user.id)['//groupname'] ];

// -- PUblic Groups to check against
var pug = ['Public', 'Corp-US Citizen', 'Corp-US Person'];

// -- Search for pub user
var pub = true;
foreach (var y in groups where pub ) 
{
    let pub = list.contains(pug,y);
}
 
// check the  public/non-public status of the user
if (pub == TRUE)
{
    // User is Public
    "you are a public user";
}
else
{
    // user is NOT public
    // be awesome
    "you are NOT a public user";
}

Initial URL

                                

Initial Description

                                

Initial Title
Reacting to Groups in Mindtouch

Initial Tags

                                

Initial Language
Other