Hello everybody,

For providing an abuse feature to my users, a flag is displayed on my node type in the "links" section. If a user clicks on it a rule does the rest. At this point everything is fine.

So far so good. But when I'm logged in as user #1 (e.g. for unflagging), the flag link isn't displayed anymore anywhere, although the privileges are approved for administrators role. Neither in the links section in my node nor in the "operation column" in the table of my view.

By the way, I always thought, that the user #1 may always do everything related to the user privileges? Am I wrong here?

When I give the privileges for set/unset the flag to my normal registered users, also everything is fine, the link is being displayed normally in the node-links.

The flag I mentioned is a global link, all non global links are displayed normally. Maybe that there is the bug?

Here is the exported flag code:

$flags = array();
// Exported flag: "Hotel melden".
$flags['hotel_profil_melden'] = array (
  'entity_type' => 'node',
  'title' => 'Hotel melden',
  'global' => '1',
  'types' => 
  array (
    0 => 'hotel',
  ),
  'flag_short' => 'Hotel melden',
  'flag_long' => 'Hotelprofil als bedenklich melden',
  'flag_message' => '',
  'unflag_short' => 'Nicht mehr melden',
  'unflag_long' => 'Hotelprofil nicht mehr als bedenklich melden',
  'unflag_message' => '',
  'unflag_denied_text' => 'Hotel wurde gemeldet',
  'link_type' => 'normal',
  'weight' => 0,
  'show_in_links' => 
  array (
    'full' => 'full',
    'token' => 'token',
    'teaser' => 0,
    'rss' => 0,
    'search_index' => 0,
    'search_result' => 0,
    'diff_standard' => 0,
  ),
  'show_as_field' => 0,
  'show_on_form' => 0,
  'access_author' => 'others',
  'show_contextual_link' => 1,
  'i18n' => 0,
  'api_version' => 3,
);
return $flags;

thx & regards
phil

CommentFileSizeAuthor
#7 untitled.png71.78 KBdercheffe
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dercheffe’s picture

Issue summary: View changes
dercheffe’s picture

Component: Views integration » Flag core
joachim’s picture

You're correct that uid 1 should see everything. I've no idea why this would be happening.

Can you debug in the flag class's access() method to see why it's denying access?

dercheffe’s picture

Could you explain me how can I debug access() please? I'm new to drupal and it's php structure, sorry. Then I'll try it :-)

dercheffe’s picture

Hi Joachim,

for the abuse-function I set the flag restrictions to "Users may only flag content of others". My user #1 is the current node author. When I set "No additional restrictions" then the flag is displayed normally. Perhaps it is better, if the content restrictions don't take effect to the uid 1 and the admin role? What do you think about?

joachim’s picture

> "Users may only flag content of others"

That's not part of Flag is it?

dercheffe’s picture

FileSize
71.78 KB

I think that it is part of flag module. For testing it I installed the flag module at a "vanilla" drupal sandbox at simplytest.me

joachim’s picture

You're right, it is part of flag. Just another of those bits that I don't really know about...

The code for that doesn't have any kind of bypass for user 1. That's something that could be added, though I am not entirely sure whether this is a bug or a design choice we'd be changing. I'm also not sure we should be changing this partway through the 7.x-3.x branch.