WeBWorK Main Forum

Link that only TA+ can see

Link that only TA+ can see

by Alex Jordan -
Number of replies: 4
I have written a pdf user guide for my local faculty to use as a reference. Brand new instructors can use it to set up their first course too. I'd like to link to its permanent location from within WeBWorK, but of course I only want instructors (or TAs, but we don't have those) to see the link. Does anyone have suggestions for how I can do this cleanly?

The pdf is at spot.pcc.edu/~ajordan/WeBWorKUserGuide.pdf. A lot of it is specific to my school and my setup, but I'm happy to provide the .tex file if anyone thinks it would be useful to modify it for the wiki.
In reply to Alex Jordan

Re: Link that only TA+ can see

by Alex Jordan -
I think ideally, I would place the link in course_info.txt if there were a way to restrict presentation of the link to only TA+.
In reply to Alex Jordan

Re: Link that only TA+ can see

by Paul Pearson -
Hi Alex,

The environment variables you would want to use are probably

$envir{permissionLevel}

$envir{effectivePermissionLevel}

Then, you can write a little code that creates an htmlLink() when the permission level is high enough.

For more stuff like this, you may also want to look into loading the macro "PGinfo.pl" and placing \{ listEnvironmentVariables() \} inside a BEGIN_TEXT / END_TEXT block.

Best regards,

Paul Pearson
In reply to Alex Jordan

Re: Link that only TA+ can see

by Alex Jordan -
I ended up adding the following to ContentGenerator.pm, right at the end of the Instructor Tools (right after the Instructor Links).

if (exists $ce->{webworkURLs}{userGuide} and $ce->{webworkURLs}{userGuide} ne ""
and $authz->hasPermissions($userID, "access_instructor_tools")) {
print CGI::li(CGI::a({href=>$ce->{webworkURLs}{userGuide}}, $r->maketext("Comprehensive User Guide for PCC faculty")));
}

And then I put a line in localOverrides.conf defining:
$webworkURLs{userGuide} = "http://spot.pcc.edu/~ajordan/WeBWorKUserGuide.pdf";