if($account->hasPermission('edit any '.$type.' content',$account)||($account->hasPermission('edit own '.$type.' content')&&($account->id()==$node->getOwnerId()))){
returnNODE_ACCESS_ALLOW;
}
if($op=='update'){
if($account->hasPermission('edit any '.$type.' content',$account)||($account->hasPermission('edit own '.$type.' content')&&($account->id()==$node->getOwnerId()))){
returnNODE_ACCESS_ALLOW;
}
}
if($op=='delete'){
if($account->hasPermission('delete any '.$type.' content',$account)||($account->hasPermission('delete own '.$type.' content')&&($account->id()==$node->getOwnerId()))){
returnNODE_ACCESS_ALLOW;
}
if($op=='delete'){
if($account->hasPermission('delete any '.$type.' content',$account)||($account->hasPermission('delete own '.$type.' content')&&($account->id()==$node->getOwnerId()))){
if($account->hasPermission('edit any '.$type.' content',$account)||($account->hasPermission('edit own '.$type.' content',$account)&&($account->id()==$node->getOwnerId()))){
returnNODE_ACCESS_ALLOW;
}
if($op=='update'){
if($account->hasPermission('edit any '.$type.' content',$account)||($account->hasPermission('edit own '.$type.' content',$account)&&($account->id()==$node->getOwnerId()))){
returnNODE_ACCESS_ALLOW;
}
}
if($op=='delete'){
if($account->hasPermission('delete any '.$type.' content',$account)||($account->hasPermission('delete own '.$type.' content',$account)&&($account->id()==$node->getOwnerId()))){
returnNODE_ACCESS_ALLOW;
}
if($op=='delete'){
if($account->hasPermission('delete any '.$type.' content',$account)||($account->hasPermission('delete own '.$type.' content',$account)&&($account->id()==$node->getOwnerId()))){
returnNODE_ACCESS_ALLOW;
}
}
...
...
@@ -1222,31 +1219,6 @@ function node_list_permissions($type) {
return$perms;
}
/**
* Returns an array of node types that should be managed by permissions.
*
* By default, this will include all node types in the system. To exclude a
* specific node from getting permissions defined for it, set the
* node_permissions_$type variable to 0. Core does not provide an interface for
* doing so. However, contrib modules may exclude their own nodes in
* hook_install(). Alternatively, contrib modules may configure all node types
* at once, or decide to apply some other hook_node_access() implementation to