You are here

function flickr_photos_access in Flickr 6

Same name and namespace in other branches
  1. 7 flickr.module \flickr_photos_access()
3 string references to 'flickr_photos_access'
flickr_menu in ./flickr.module
Implements hook_menu().
flickr_sets_menu in sets/flickr_sets.module
Implements hook_menu().
flickr_tags_menu in tags/flickr_tags.module
Implements hook_menu().

File

./flickr.module, line 99

Code

function flickr_photos_access($account) {
  global $user;
  $photo_access = FALSE;
  if (!empty($account) && !empty($account->uid)) {
    if (isset($account->flickr['nsid'])) {
      $photo_access = user_access('administer flickr') || $account->status && (user_access('view all flickr photos') || user_access('view own flickr photos') && $user->uid == $account->uid);
    }
    else {
      drupal_set_message(t('%user does not have a Flickr account', array(
        '%user' => $account->name,
      )), 'error');
    }
  }
  return $photo_access;
}