-
Notifications
You must be signed in to change notification settings - Fork 111
[3.0] AssertionInterface is now using an AuthorizationContext #250
Conversation
This closes #240 |
@@ -55,6 +56,11 @@ class AuthorizationService implements AuthorizationServiceInterface | |||
protected $assertions = []; | |||
|
|||
/** | |||
* @var string | |||
*/ | |||
protected $contextClass = 'ZfcRbac\Assertion\AuthorizationContainer'; |
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.
What is that?
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.
A classic facepalm, forgot to remove that ;D
* @return bool | ||
*/ | ||
public function assert(AuthorizationService $authorizationService); | ||
public function assert(AuthorizationServiceInterface $authorizationService, AuthorizationContext $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.
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.
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.
$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.
I've created a develop branch. Could you make the PR against the develop branch? |
This is a BC, when moving to 3.0 we should include this in Upgrade.md!