|
@@ -99,26 +99,22 @@ function tripal_project_perm() {
|
|
|
function chado_project_access($op, $node, $account) {
|
|
|
|
|
|
if ($op == 'create') {
|
|
|
- // Only users with permission to do so may create this node type.
|
|
|
- if (!user_access('create chado_projects', $account)) {
|
|
|
+ if (!user_access('create chado_project content', $account)) {
|
|
|
return FALSE;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- // Users who create a node may edit or delete it later, assuming they have the necessary permissions.
|
|
|
- if ($op == 'update' || $op == 'delete') {
|
|
|
-
|
|
|
- if (!user_access('edit own chado_projects', $account)) {
|
|
|
+ if ($op == 'update') {
|
|
|
+ if (!user_access('edit chado_project content', $account)) {
|
|
|
return FALSE;
|
|
|
}
|
|
|
- if (user_access('edit own chado_projects', $account) &&
|
|
|
- $account->uid != $node->uid) {
|
|
|
+ }
|
|
|
+ if ($op == 'delete') {
|
|
|
+ if (!user_access('delete chado_project content', $account)) {
|
|
|
return FALSE;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
if ($op == 'view') {
|
|
|
- if (!user_access('access chado_projects', $account)) {
|
|
|
+ if (!user_access('access chado_project content', $account)) {
|
|
|
return FALSE;
|
|
|
}
|
|
|
}
|