Filtering link associated with view based on permissions I have a view, print a list of meetings. Using the 'custom text' option I added a link related to the meeting - 'clone meeting'. If the person has a particular permission for the meeting then I would like display the link, but only then. 

I don't want to filter the whole record, so can't see a way using hook_views_pre_render(). I could regex the rendered content in hook_views_post_render(), but this seems error prone. How should the conditional link be added?

Drupal 7. Views 7.x-3.5.
Resolved by: 


Installing views php
Creating a static class with the permission logic in it. 
Editing the view to have Global:PHP as a field. 


The class is autoloaded via module.info file. files[] = 'MyClass.inc'. Static function is just a facade to the module function so that it will be in scope. 

class MeetingClonePerms {
  public static function accessCloning($nid) {
    // Calls module function here. 


The php in Global:PHP views field is in 'output code':

&lt;?php 
if (MeetingClonePerms::accessCloning($row-&gt;nid)) {
  print  '&lt;a href="/meetingclone/clone/' . $row-&gt;nid . '"&gt;clone&lt;/a&gt;';
}
?&gt;