Oh hai we are ignoring your earlier result:
// Base initial access on the user's basic permission to use this flag.
$access = $this->user_access($action, $account);
// Check for additional access rules provided by sub-classes.
$child_access = $this->type_access($entity_id, $action, $account);
if (isset($child_access)) {
$access = $child_access;
}
If user_access() says FALSE, and type_access() says TRUE, then SHAZAM the user gets access anyway!
Fortunately, only flag_user overrides type_access(), and it returns FALSE or NULL. So that's ok.
I am guessing that the intention is that type_access() can only deny access, not grant it. In other words, it only returns FALSE (to deny) or NULL (to say nothing). However, this needs documenting, HARD.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | flag-1881964-3.patch | 939 bytes | cs_shadow |
| #1 | 1881964.flag_.type-access-return-docs.patch | 1013 bytes | joachim |
Comments
Comment #1
joachim commentedIssue #1881964 by joachim: Fixed missing documention for type_access() and type_access_multiple() return value.
Comment #2
joachim commentedShould be backported.
Comment #3
cs_shadow commentedAttaching the patch backported for 7.x-2.x-dev.
Comment #4
cs_shadow commentedComment #6
joachim commentedCommitted. Sorry for the delay!