Move access policy plugins into their own directory

Created on 28 October 2023, about 1 year ago
Updated 4 November 2023, about 1 year ago

Problem/Motivation

Right now, all 8 access policy type plugins are stored in src/Plugin directory. As a result, you can get a lot of those plugins dispersed amongst all other sorts of plugin types which aren't related to access policy and it makes it look messy.

Proposed resolution

Move the access policy plugins to src/Plugin/access_policy and update their namespaces.

API changes

When creating your own access policy plugin (access rule, selection rule, access policy type etc). you need to do the following:

Save the plugin in the access_policy directory:

my_module/src/Plugin/access_policy/AccessRule/CustomAccessRule.php

Make sure that the namespace is correct:

namespace Drupal\my_module\Plugin\access_policy\AccessRule;

use Drupal\access_policy\Plugin\access_policy\AccessRule\AccessRuleBase;

/**
 * My custom access rule.
 */
class CustomAccessRule extends AccessRuleBase {
  // ...
}
πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States partdigital

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024