With view only permission to a node, it seems that node permissions affect batch node flag. Would it be possible to use flag permission since flagging a node doesn't neccessarily involve editing a node.

Joseph

CommentFileSizeAuthor
#13 flag_operations_behavior.patch802 bytesquicksketch

Comments

infojunkie’s picture

Category: bug » feature

The problem is that node flagging is done via a node_operation, not an action. Node operations don't advertise whether they modify nodes or not, so in the spirit of security, VBO assumes that they do. In order to get around this, it would be necessary for third parties (e.g. the VBO admin) to inform VBO which node_operations are safe and which aren't. I'll consider this a feature request.

infojunkie’s picture

As a workaround, you can patch the declaration of function flag_node_operations() in flag.module as the following:

    $operations['flag_'. $flag->name] = array(
      'label' => $flag->get_label('flag_short'),
      'callback' => 'flag_nodes',
      'callback arguments' => array('flag', $flag->name),
      'behavior' => array(),
    );
    $operations['unflag_'. $flag->name] = array(
      'label' => $flag->get_label('unflag_short'),
      'callback' => 'flag_nodes',
      'callback arguments' => array('unflag', $flag->name),
      'behavior' => array(),
    );

The behavior entry explicitly informs VBO that flag operations do not modify the node.

jmolinas’s picture

ive already patched the flag module by it does't seems to work

infojunkie’s picture

Category: feature » support

Try clearing the cache. What doesn't work? What's the message that you get that indicates failure?

jmolinas’s picture

Still if the user dont have enough privilages, you cannot execute the flag operation (Not enough privilages)

infojunkie’s picture

I've re-tested this patch successfully. Are you sure you don't have two versions of flag.module in your installation?

jmolinas’s picture

I'm using flags 6.x-1.1

infojunkie’s picture

Version: 6.x-1.7 » 6.x-1.x-dev

I meant look in your module folders to see if there aren't two copies of flags module.

If there's only one copy, please download the latest dev release of VBO and try again:
* Make sure the actions_permissions module is disabled.
* Does the bookmark action still appear in the operations list for non-admin users?
* If it does, try to execute the action. What is the exact error message that you get?

jmolinas’s picture

thank a lot!!! it works!!

infojunkie’s picture

Status: Active » Fixed

Can you let us know what you did to fix the problem?

jmolinas’s picture

comment number 2 worked fom me

RoboPhred’s picture

Project: Views Bulk Operations (VBO) » Flag
Component: Code » Actions integration
Category: support » bug
Status: Fixed » Needs review

Changing a module's code by hand can hardly be consitered "fixed".

quicksketch’s picture

Status: Needs review » Fixed
StatusFileSize
new802 bytes

Fixed with the attached patch. Committed to all versions of Flag.

quicksketch’s picture

Title: Cannot batch flag node without edit or delete permission » Cannot flag node without edit or delete permission (with VBO)
infojunkie’s picture

Thanks quicksketch for taking the trouble to integrate with VBO!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.