Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

[3.0] AssertionInterface is now using an AuthorizationContext #250

Closed
wants to merge 2 commits into from

Conversation

aeneasr
Copy link
Contributor

@aeneasr aeneasr commented Jun 20, 2014

This is a BC, when moving to 3.0 we should include this in Upgrade.md!

@aeneasr
Copy link
Contributor Author

aeneasr commented Jun 20, 2014

This closes #240

@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) when pulling fcd38c9 on arekkas:master-assertion-refactor into 8cf2a49 on ZF-Commons:master.

@@ -55,6 +56,11 @@ class AuthorizationService implements AuthorizationServiceInterface
protected $assertions = [];

/**
* @var string
*/
protected $contextClass = 'ZfcRbac\Assertion\AuthorizationContainer';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A classic facepalm, forgot to remove that ;D

@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) when pulling 022c562 on arekkas:master-assertion-refactor into 8cf2a49 on ZF-Commons:master.

* @return bool
*/
public function assert(AuthorizationService $authorizationService);
public function assert(AuthorizationServiceInterface $authorizationService, AuthorizationContext $context);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really for making the context mandatory. Sometimes you actually don't need context, isn't it? So I think AuthorizationContext $context = null is better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$context->getContext() may indeed be null, $context->getPermission() has always a value, so I have to disagree. Also, I do not understand how that should work within the authservice, which passes the context container always.

@bakura10
Copy link
Member

I've created a develop branch. Could you make the PR against the develop branch?

@aeneasr aeneasr closed this Jun 22, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants