-
Notifications
You must be signed in to change notification settings - Fork 16
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
WIP: Allow creating per bundle/ per group roles #209
base: default-roles
Are you sure you want to change the base?
Conversation
@pfrenssen this is just a beggining, but maybe can already give you a hint on my direction |
*/ | ||
protected function createRoles($entity_type_id, $bundle_id) { | ||
protected function createRoles($entity_type_id, $bundle_id = NULL, $group_id = NULL) { |
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.
@pfrenssen I guess it is a bit ugly having to pass either bundle ID or group ID. Which made me thing that maybe we should have two Og Roles bundles: per_bundle
and per_group
so the schema will just have those two keys: group_type
and reference_id
(bad name) . reference_id
will be populated either with the bundle ID or the group ID.
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.
OgRole
is a config entity, I don't think this supports bundles. If you look at the inherited method OgRole::bundle()
you see it returns the entity type instead of the bundle. Only content entities support custom bundles out of the box.
But I actually think we can hack in bundle support easily. We just need to ensure that the bundle is stored along with the entity, that we have a $this->bundle
property that we populate in the constructor, and then we can use it to handle per_bundle
and per_group
specific logic.
Here are some thoughts:
@pfrenssen what do you think about 4? Not sure how to tackle it, and still be able to share code between the classes. |
Assigning to me so I won't forget to review this and answer the questions. |
A possible solution to having to reference both So This means we can break it to smaller PRs:
|
#208