Skip to content
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

Closed

Conversation

torenware
Copy link
Contributor

@@ -11,7 +11,13 @@
use \Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery as CoreAnnotatedClassDiscovery;

/**
* Extends the annotation class discovery for usage with Rules context.
Copy link
Owner

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.

@torenware torenware force-pushed the configure-permission-2593139 branch 2 times, most recently from b44783d to 0ee695b Compare November 26, 2015 08:42
@@ -51,6 +51,14 @@ class RulesAction extends Plugin {
public $category;

/**
* The permission required to access the configuration UI for this plugin.
*
* @var string
Copy link
Collaborator

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.

@torenware torenware force-pushed the configure-permission-2593139 branch 3 times, most recently from a319416 to 81307a0 Compare November 26, 2015 10:38
$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.");
Copy link
Collaborator

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.

@klausi
Copy link
Collaborator

klausi commented Dec 1, 2015

merged, thanks!

@klausi klausi closed this Dec 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants