I ended up adding the function
sub if_permissionlevel { my ($self, $arg) = @_; my $r = $self->r; my $db = $r->db; my $userID = $r->param('user'); #bail out if not logged in return 0 unless $userID; if ($db->getPermissionLevel($userID)->permission == $arg) { return 1; } else { return 0; } }to ContentGenerator.pm, to get e.g. <!--#if permissionlevel="10"--> to work in the template showing content only to (in this case) professors.