You are here

function weather_access_userblock in Weather 7

Same name and namespace in other branches
  1. 7.3 weather.module \weather_access_userblock()
  2. 7.2 weather.module \weather_access_userblock()

Checks whether the user has access to their own custom weather block.

Parameters

int $uid: User id.

Return value

boolean TRUE or FALSE.

1 call to weather_access_userblock()
weather_block_view in ./weather.module
Implement hook_block_view().
1 string reference to 'weather_access_userblock'
weather_menu in ./weather.module
Implement hook_menu().

File

./weather.module, line 563
Display current weather data from many places in the world.

Code

function weather_access_userblock($uid = NULL) {
  global $user;

  // If $uid is not set, just check for the access permission.
  if (is_null($uid) || $user->uid == $uid) {
    return user_access('administer custom weather block');
  }
  return FALSE;
}