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

[RbacBundle] Teach the RbacInitializer to append new permissions #3106

Merged
merged 1 commit into from
Aug 11, 2015
Merged

[RbacBundle] Teach the RbacInitializer to append new permissions #3106

merged 1 commit into from
Aug 11, 2015

Conversation

jimbocoder
Copy link
Contributor

Q A
Bug fix? no
New feature? no
BC breaks? unlikely
Deprecations? no
Fixed tickets
License MIT
Doc PR

Previously, you could basically only use the RbacInitializer once, to
create roles with their permissions. If you add new permissions to
existing roles (e.g. via configuration like rbac.yml) these won't be
added by the initializer.

This commit makes the initializer always try to add new permissions to
roles, new or old, and updates the console output a bit to reflect the
behavior.


foreach ($data['permissions'] as $permission) {
foreach ($data['permissions'] as $permission) {
if ( !$role->hasPermission($this->permissionsByCode[$permission]) ) {
Copy link
Member

Choose a reason for hiding this comment

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

CS

existing roles.

Previously, you could basically only use the RbacInitializer once, to
create roles with their permissions. If you add new permissions to
existing roles (e.g. via configuration like rbac.yml) these won't be
added by the initializer.

This commit makes the initializer always try to add new permissions to
roles, new or old, and updates the console output a bit to reflect the
behavior.
pjedrzejewski pushed a commit that referenced this pull request Aug 11, 2015
[RbacBundle] Teach the RbacInitializer to append new permissions
@pjedrzejewski pjedrzejewski merged commit 6503310 into Sylius:master Aug 11, 2015
@pjedrzejewski
Copy link
Member

Thanks Jim!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants