How do I check Organic Groups group permissions from a custom module?
if your group entity is a node which I'm guessing it should be change your code to:

$gid // your group's node id.
$allowed = og_user_access('node', $gid, 'create resource content');