Get all users with edit/view permission for a node I'm working on a Drupal 7 project. And for this I need to get all the users that have a certain permission for a node. I need this info in the hook_node_update method, which means that I can currently get the $node object just fine but I'm unable to find a way to query a list of users that have edit rights to the particular node that's being updated.

Can anyone provide an insight? That would be great!

Thanks.
Every content type has fix pattern of permission

For node edit permission, Just use user_access() with string parameter
"edit own [content-type] content"
OR
"edit any [content-type] content"
If current user has this permission it return TRUE else FALSE

AND

If you want this permission for other user, Just pass user object as second argument in user_access()