function filebrowser_node_access in Filebrowser 7.2
Same name and namespace in other branches
- 8.2 filebrowser.module \filebrowser_node_access()
- 8 filebrowser.module \filebrowser_node_access()
- 7.4 filebrowser.module \filebrowser_node_access()
- 7.3 filebrowser.module \filebrowser_node_access()
- 3.x filebrowser.module \filebrowser_node_access()
hook_node_access implementation.
File
- ./
filebrowser.module, line 821
Code
function filebrowser_node_access($node, $op, $account) {
if ($op == 'view') {
if (!user_access(FILEBROWSER_VIEW_DIRECORY_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_DIRECORY_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;
}
}
}