Skip to content

Instantly share code, notes, and snippets.

@jimmydivvy
Created May 18, 2009 04:32
Show Gist options
  • Save jimmydivvy/113317 to your computer and use it in GitHub Desktop.
Save jimmydivvy/113317 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