I am reporting https://www.drupal.org/node/2122195 to moderators because on this page it says:
Sometimes just relying on permissions and/or roles is not sufficient and you need to do custom access checking on routes. To achieve this, implement a class with AccessCheckInterface and use that to check access.
However the provided example does not implement anything. I looked at several examples in core and they seem to all use implements AccessInterface
. So does this mean there is a typo here.
If it should in fact AccessInterface
, there is one more issue. AccessInterface
seems to be redundant now:
/**
* @file
* Contains \Drupal\Core\Routing\Access\AccessInterface.
*/
namespace Drupal\Core\Routing\Access;
/**
* An access check service determines access rules for particular routes.
*/
interface AccessInterface {
// @todo Remove this interface since it no longer defines any methods?
// @see https://drupal.org/node/2266817.
}
Remaining tasks
Extend example to implement AccessInterfaceRewrite example once AccessInterface is redundant (but see #2266817: Deprecate empty AccessInterface and remove usages
Comments
Comment #1
jhodgdonThanks for the report.
Comment #2
jp.stacey CreditAttribution: jp.stacey at Magnetic Phield commentedI've edited the description of this ticket to describe the two separate tasks I think are necessary here.
Right now, the class in the documentation does implement AccessInterface, so that might be a recent change. Either way I've struck it out in the description. But the task to rewrite the documentation when #2266817: Deprecate empty AccessInterface and remove usages is complete, is actually part of that other issue.
So I think this issue could be closed as a combination of already-done and is-now-a-duplicate. We could maybe mention it in passing on #2266817 too.
Comment #3
jp.stacey CreditAttribution: jp.stacey at Magnetic Phield commentedComment #4
jp.stacey CreditAttribution: jp.stacey at Magnetic Phield commentedAs it's been two weeks since I proposed closing this, I'm doing so now. I'll reference it on the other issue.