You are here

function imagecrop_access_denied in Image javascript crop 7

Check if the user has access to the given file.

File

./imagecrop.module, line 578
Provides a javascript toolbox through an imagecache action.

Code

function imagecrop_access_denied($file) {

  // User doesn't have acess to imagecrop.
  if (!user_access('crop any image') && !user_access('crop own images')) {
    return;
  }

  // User doesn't have access to crop current file.
  global $user;
  if ($file && !user_access('crop any image') && $file->uid != $user->uid) {
    return;
  }
}