-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Rbac][RbacBundle] Introduce code for Rbac #3730
Conversation
tuka217
commented
Dec 16, 2015
Q | A |
---|---|
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
Deprecations? | no |
Fixed tickets | - |
License | MIT |
Doc PR | - |
a1d4117
to
94d9eca
Compare
94d9eca
to
7f3be22
Compare
return; | ||
} | ||
|
||
if(!$resource instanceof RoleInterface && !$resource instanceof PermissionInterface) { |
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.
Missing space after if
.
89216c6
to
d2f1ede
Compare
|
||
function it_is_initializable() | ||
{ | ||
$this->shouldHaveType(AddParentFormSubscriber::class); |
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.
You should use FQCN in this one instead of ::class
as stated in #3736 (comment)
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.
👍
Requires rebasing. |
d2f1ede
to
4c8e12e
Compare
throw new UnexpectedTypeException($resource, RoleInterface::class, PermissionInterface::class); | ||
} | ||
|
||
if (null === $resource->getId() XOR null === $resource->getParent()) { |
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 condition changes the previous behavior:
ConditionBefore (remove parent when true):
null !== $permission->getId() && null === $permission->getParent()
ConditionNow (add parent when false):
null === $resource->getId() XOR null === $resource->getParent()
ID | Parent | ResultBefore | ResultNow |
---|---|---|---|
null | null | add parent | add parent |
null | not null | add parent | no parent |
not null | null | no parent | no parent |
not null | not null | add parent | add parent |
The proper condition should be:
null !== $resource->getId() && null === $resource->getParent()
Unless we want to change behavior?
4c8e12e
to
a52c472
Compare
…face [RbacBundle] Add AddParentFormSubscriber, add this and AddCodeFormSubscriber to builder in PermissionType and RoleType
a52c472
to
d3e1c54
Compare
[Rbac][RbacBundle] Introduce code for Rbac
Thanks Ania! 👍 |