Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By kiova on
I want to make image module coplately unreachable by anonymous users...
image module has this codes for permissions and i tried to add "view images" condition but i could not get it working right... How can i do this? thanks.
/**
* Implementation of hook_perm
*/
function image_perm() {
return array('administer images', 'create images');
}
/**
* Implementation of hook_access
*/
function image_access($op, $node) {
global $user;
if ($op == 'create' && user_access('create images')) {
return TRUE;
}
if ($op == 'update' && $user->uid == $node->uid) {
return TRUE;
}
if ($op == 'delete' && $user->uid == $node->uid) {
return TRUE;
}
}