Is this the behaviour desired? i mean, when a user has permission to change the workflow it also grants him with the permission to actually edit the node. Is there a way of grant only the permission to change the workflow, but no to edit the node? in simple words: i want a user to see to workflow tab but no the edit tab.

Comments

JacobSingh’s picture

Yes, you can do that already I believe.

There are separate permissions. See admin/user/access.

There is a separate perm for workflow

Best,
Jacob

leanazulyoro’s picture

in the access control the role doesn't have the permission to edit the node. but i created a workflow and assign the permission to change the states to the same role. the thing is that users in that rol, will still be able to edit the node even when in access control it says it doesn't.

JacobSingh’s picture

If you've set up your workflow transition perms correctly, it should work.

Here is the code which decides if the user can see the tab:

if ($wid) { // workflow exists for this type
        global $user;
        $roles = array_keys($user->roles);
        if ($node->uid == $user->uid) {
          $roles = array_merge(array('author'), $roles);
        }
        $workflow = db_fetch_object(db_query("SELECT * FROM {workflows} WHERE wid = %d", $wid));
        $allowed_roles = $workflow->tab_roles ? explode(',', $workflow->tab_roles) : array();
        $items[] = array('path' => "node/$node->nid/workflow",
          'title'    => t('Workflow'),
          'access'   => array_intersect($roles, $allowed_roles) || user_access('administer nodes'),
          'type'     => MENU_LOCAL_TASK,
          'weight'   => 2,
          'callback' => 'workflow_tab_page',
          'callback arguments' => arg(1),
        );
      }

leanazulyoro’s picture

i'm not an expert in php, just confirm me that it should work as i need, i will then try to find the source of the problem (that at this point i could call bug). i repeat the behaviour i'm getting:
i have a user that has permission to see the node, but not edit it. if i don't assign any workflow to the node, the user sees the node, but can't edit it. but as soon as i assign a workflow to the node, and grant the user with permissions to make all transsitions among states, then the user sees the node with the workflow tab, but also with the edit tab, and he can actually edit it.

Bastlynn’s picture

Status: Active » Closed (won't fix)

Hi,

With the release of Drupal 7, Drupal 5 is no longer receiving security updates, reviews, or development from many contributed modules. Since 5 is now considered a depreciated version, you really should seriously look into upgrading to Drupal 6 or 7. The newer versions of Drupal work better, have more support, and will be safer (literally! security patches!) for your website. We are currently working on a new release for Workflow to Drupal 7. In light of that, further support for Drupal 5 issues is infeasible at the moment. Please consider upgrading to Drupal 6 or 7 in the near future - you'll be glad you did.

- Bastlynn