Add documentation comments to the views access plugins as described in #1882558: [META] Document all views plugins types.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Task because we are adding more detail to the documentation of AccessPluginBase.
Issue priority Normal because this change is has no widespread impact.
Unfrozen changes Unfrozen because it only changes the ViewsAccessPlugin documentation.
Prioritized changes None
Disruption None
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

thsutton’s picture

Add details to the documentation block for AccessPluginBase.

dawehner’s picture

Beside this small thing below, I'm wondering whether it makes sense to provide an example here for the access/get_access_callback methods.

+++ b/core/modules/views/lib/Drupal/views/Plugin/views/access/AccessPluginBase.phpundefined
@@ -21,6 +21,26 @@
+ * To define an access control plugin, extend this base class. The
+ * ViewsPluginManager (used to create views plugins objects) adds annotated
+ * discovery for block plugins. Your access plugin should have an annotation

The middle sentence is confusing, as it is 100% out of context :)

zealfire’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
1.2 KB

Since, this issue has remained inactive for a long time period i have decided to work on it.Is it fine? Also i am submitting a new patch but still not sure whether we need to add example for access method.Please review.
Thanks.

dawehner’s picture

Since, this issue has remained inactive for a long time period i have decided to work on it.Is it fine?

Always!

IMHO instead of given an example you could also just point to a congrete instance.

meramo’s picture

Still applies, however I think that having two comment blocks stacked one after another might not be a good idea, provided they're explaining the same thing basically. May be the first one should go to the @file section?

Anonymous’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/views/src/Plugin/views/access/AccessPluginBase.php
    @@ -29,6 +29,25 @@
    + * Access plugins are responsible for controlling access to the view. Views
    + * includes plugins for checking user roles and individual permissions.
    

    While I get this, I find it a bit confusing. Some rewording could help.

  2. +++ b/core/modules/views/src/Plugin/views/access/AccessPluginBase.php
    @@ -29,6 +29,25 @@
    + * To define an access control plugin, extend this base class.Your access
    

    Missing a space after the dot.

  3. +++ b/core/modules/views/src/Plugin/views/access/AccessPluginBase.php
    @@ -29,6 +29,25 @@
    + * - short_title: A shorter name for your plugin
    

    Judging from the example, this one is optional?

May be the first one should go to the @file section?

I'm not entirely sure, but I think those follow a guideline and should be left as-is.

mikebell_’s picture

I've fixed the minor formatting issues and removed short title since it's optional.

I get what your saying regarding the first lines so I added a bit more text and move the second sentence to it's own line. It flows a lot cleaner now.

isholgueras’s picture

Assigned: thsutton » Unassigned
Status: Needs work » Needs review

The last submitted patch, 1: document-views-access-base-plugin-1912658-1.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 7: revised-views-access-plugins-1912658-7.patch, failed testing.

The last submitted patch, 1: document-views-access-base-plugin-1912658-1.patch, failed testing.

The last submitted patch, 7: revised-views-access-plugins-1912658-7.patch, failed testing.

Status: Needs work » Needs review
Anonymous’s picture

Status: Needs review » Needs work

Oh yes, this is way clearer to me.

Only a nitpick left:

+++ b/core/modules/views/src/Plugin/views/access/AccessPluginBase.php
@@ -29,6 +29,24 @@
+ * Access plugins are responsible for controlling a users access to the view.

user's?

joshi.rohit100’s picture

Status: Needs work » Needs review
FileSize
1.16 KB
704 bytes
Anonymous’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
Issue tags: -Novice

Looks good to me. Added a beta eval.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed f2c047c and pushed to 8.0.x. Thanks!

  • alexpott committed f2c047c on 8.0.x
    Issue #1912658 by joshi.rohit100, thsutton, mikebell_, zealfire,...

Status: Fixed » Closed (fixed)

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