Display data basing on the group permission I have implemented hook_og_permission() in a custom module.

/**
* Implements hook_og_permission().
*/

function logic_board_og_permission(){
   return array(
    'rulesprm' =&gt; array(
      'title' =&gt; t('Rules Form Perm'), 
      'description' =&gt; t("Allow og user to fill form"),
    ),
  );
}


Using this permission like in the following code doesn't work: The code inside the if() statement is not executed.

    if (user_access('rulesprm')) {
      // Some code
    }


Why?
user_access is for core permissions, I.e. those added through hook_permission. For organic groups’ own permissions hook, you need to use the complementary og_user_access:, eg:

if (og_user_access($group_type, $gid, 'rulesprm')) {
  ...
}