New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #2593139: Add configuration_access annotation key for plugins. #287
Conversation
9f9e4cb
to
5fccaa9
Compare
@@ -11,7 +11,13 @@ | |||
use \Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery as CoreAnnotatedClassDiscovery; | |||
|
|||
/** | |||
* Extends the annotation class discovery for usage with Rules context. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was right actually, it's more than just annotations - let's leave the old comment.
b44783d
to
0ee695b
Compare
@@ -51,6 +51,14 @@ class RulesAction extends Plugin { | |||
public $category; | |||
|
|||
/** | |||
* The permission required to access the configuration UI for this plugin. | |||
* | |||
* @var string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be string[]? EDIT: not sure about this, so we can leave it as a single permission right now.
a319416
to
81307a0
Compare
$this->assertTrue($plugin->checkConfigurationAccess(), "User with permission has configuration access."); | ||
|
||
$object_result = $plugin->checkConfigurationAccess($user_with_perm->reveal(), TRUE); | ||
$this->assertTrue($object_result instanceof AccessResult, "an AccessResult object is returned if an object is requested."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should assert here that $object_result->isAllowed() is true, no need to check the class.
81307a0
to
72d1297
Compare
72d1297
to
02ab4d0
Compare
merged, thanks! |
Drupal Issue https://www.drupal.org/node/2593139.