You are here

function sharemessage_access in Share Message 7

Access callback for sharemessage.

2 string references to 'sharemessage_access'
sharemessage_entity_info in ./sharemessage.module
Implements hook_entity_info().
sharemessage_test_menu in tests/modules/sharemessage_test/sharemessage_test.module
Implements hook_menu().

File

./sharemessage.module, line 147
New Sharing Module.

Code

function sharemessage_access($op, $sharemessage, $account = NULL, $entity_type = NULL) {
  switch ($op) {
    case 'view':

      // Check whether there is actually an entity that gets rendered. The view
      // permission is also used on the entity admin ui. There, the ShareMessage
      // object is null and the access check falls back to the admin permission.
      if (!empty($sharemessage)) {
        return user_access('view sharemessage entities', $account);
      }
    default:
      return user_access('administer sharemessage entities', $account);
  }
}