/**
   * User access permission for flagging actions.
   *
   * Checks whether a user has permission to flag/unflag or not.
   *
   * @param string $action
   *   An indicator flag.

The first line doesn't really make sense to me. Can it be dropped?

The description of $action is wrong.

Comments

socketwench’s picture

Status: Active » Needs review
StatusFileSize
new455 bytes

Yeah, sure.

lokapujya’s picture

StatusFileSize
new516 bytes
new516 bytes

Update for the parameter description.

First patch to Flag.

joachim’s picture

Status: Needs review » Needs work

Cool! Welcome to the Flag issue queue :)

Though we should have a single patch that's the whole fix, rather than two. Could you reroll, and incorporate the changes from both #1 and #2 please?

While we're at it, we should probably specify that $action can be one of 'flag' or 'unflag'.

lokapujya’s picture

Status: Needs work » Needs review
StatusFileSize
new627 bytes

Not sure what to do about the the parameter, because currently the following code exists that does not send 'flag' or 'unflag': (in FlagService.php)

<?php
$flag->hasActionAccess('flag ' . $flag->id(), $account)
?>
joachim’s picture

Status: Needs review » Needs work

That's surely a bug, since the code as it stands is just going to deny access for that. Filed #2416517: Incorrect call to hasActionAccess() in getFlags(). Well spotted!

Let's go with what the code in the method in question says, and say it's either 'flag' or 'unflag'.

lokapujya’s picture

Status: Needs work » Needs review
StatusFileSize
new654 bytes

Ok.

joachim’s picture

Status: Needs review » Fixed

Congrats on you first commit to Flag! :)

  • joachim committed 54667c5 on 8.x-4.x authored by lokapujya
    Issue #2415413 by lokapujya, socketwench: Fixed errors in docs for...

Status: Fixed » Closed (fixed)

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