As initially proposed here in #1550540: Rules "Permission check" parameters are inverted; should be "Skip permission check" the "Trim a flag" rule action does not provide for permissions to be overridden when doing the trim. Since a trim is effectively a bulk unflag, it seems appropriate to support overrides as the unflag rule action does.

Proposed resolution

Provide this parameter as a checkbox in the rules configuration.

Remaining tasks

Patch rolling shortly, reviews needed

User interface changes

New checkbox for "Skip permission check" in the Trim a flag rule action configuration form.

API changes

The procedural function flag_trim_flag() now accepts $skip_permission_check as an optional argument, defaults to FALSE.

#2 flag-feature_skip_permissions_for_trim-1689510-2.patch4.87 KBshabana.navas
PASSED: [[SimpleTest]]: [MySQL] 266 pass(es). View


joachim’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
shabana.navas’s picture

Assigned: c4rl » shabana.navas
Status: Active » Needs review
4.87 KB
PASSED: [[SimpleTest]]: [MySQL] 266 pass(es). View

The patch for this has been attached. Hope you guys can review it.

shabana.navas’s picture

I think this patch is good to commit. Any of you guys have any opinions before I commit?

shabana.navas’s picture

Status: Needs review » Fixed

Committed to version 7.x-3.x.

Volx’s picture

Status: Fixed » Needs work

This commit introduced an error on line 2140 of flag.module. The line now starts with a +.

joachim’s picture

Status: Needs work » Fixed

Dunno how that happened -- patch looks fine!

Thanks for reporting this. Fixed :)

Status: Fixed » Closed (fixed)

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