Skip to content

Instantly share code, notes, and snippets.

@ghettocounselor
Forked from jimmydivvy/gist:113317
Created May 18, 2009 05:35
Show Gist options
  • Select an option

  • Save ghettocounselor/113337 to your computer and use it in GitHub Desktop.

Select an option

Save ghettocounselor/113337 to your computer and use it in GitHub Desktop.
// Get the first assessments that link to the current one, and grant access if we can view it
def currentuser = context.getUser(); // The current user object
def assessment = args["assessment"];
def incoming_links = assessment.getLinksTo();
if( incoming_links )
{
def first_incoming = incoming_links[0]; // We assume only one incoming link
return first_incoming.canView(); // Could also use canEdit()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment