One other way, which I went with when I had a similar issue was to go with actions instead of going with hook_node_operations. Views bulk operations comes with Actions permissions module ( <meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://drupalcode.org/viewvc/drupal/contributions/modules/views_bulk_operations/actions_permissions.module?revision=1.1.2.3&view=markup&pathrev=DRUPAL-6--1-9">http://drupalcode.org/viewvc/drupal/contributions/modules/views_bulk_operations/actions_permissions.module?revision=1.1.2.3&view=markup&pathrev=DRUPAL-6--1-9</a> ) <div>
<br></div><div>which will automatically create execute permissions for each action defined on your site. Then you can define which role has access to execute which action and only those actions then will be shown to the user depending on the role.</div>
<div><br></div><div>Hope that helps.</div><div><br clear="all">----------------------------------<br>Dipen Chaudhary<br>Founder, QED42 : We build beautiful and scalable web strategies ( <a href="http://www.qed42.com">www.qed42.com</a> )<br>
Blog: <a href="http://dipenchaudhary.com">dipenchaudhary.com</a><br>Twitter: <a href="http://twitter.com/dipench">http://twitter.com/dipench</a><br><br>
<br><br><div class="gmail_quote">On Tue, Aug 31, 2010 at 12:33 AM, Steve Yelvington <span dir="ltr"><<a href="mailto:steve@yelvington.com">steve@yelvington.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div text="#000000" bgcolor="#ffffff">
<br>
I'm implementing a bulk user operation as described in sirkitree's blog
post:<br>
<a href="http://sirkitree.net/node/23" target="_blank">http://sirkitree.net/node/23</a><br>
<br>
I don't see anything in the hook_node_operations() docs that addresses
permissions. I'd like to provide discrete control over whether my
operation is available, rather than having it show up in every VBO view
that happens to return users.<br>
<br>
Do I do that by having my implementation of hook_user_operations return
a null array if the current user has no permissions? Or should I
conditionally define my implementation of hook_user_operations
depending on a user_access() call? <br>
<br>
Or am I missing some other option?<br>
<br>
<br>
</div>
</blockquote></div><br></div>