function filebrowser_node_access in Filebrowser 7.4
Same name and namespace in other branches
- 8.2 filebrowser.module \filebrowser_node_access()
- 8 filebrowser.module \filebrowser_node_access()
- 7.2 filebrowser.module \filebrowser_node_access()
- 7.3 filebrowser.module \filebrowser_node_access()
- 3.x filebrowser.module \filebrowser_node_access()
implements hook_node_access @inheritdoc
File
- ./
filebrowser.module, line 1097
Code
function filebrowser_node_access($node, $op, $account) {
if ($op == 'view') {
if (!user_access(FILEBROWSER_VIEW_DIRECTORY_LISTINGS, $account)) {
return FALSE;
}
}
if ($op == 'create') {
if (!user_access(FILEBROWSER_CREATE_DIRECTORY_LISTING, $account)) {
return FALSE;
}
}
if ($op == 'update') {
if (!user_access(FILEBROWSER_EDIT_ANY_DIRECTORY_LISTINGS, $account) || !(user_access(FILEBROWSER_EDIT_OWN_DIRECTORY_LISTINGS, $account) && $account->uid == $node->uid)) {
return FALSE;
}
}
if ($op == 'delete') {
if (!user_access(FILEBROWSER_DELETE_ANY_DIRECTORY_LISTINGS, $account) || user_access(FILEBROWSER_DELETE_OWN_DIRECTORY_LISTINGS, $account) && $account->uid == $node->uid) {
return FALSE;
}
}
}